Flaky API Test: TestWebKitAPI.ProcessSwap.NavigateToDataURLThenBack
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2019 00:43:38 +0000 (00:43 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2019 00:43:38 +0000 (00:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194545

Reviewed by Brady Eidson.

Make sure the test navigates forward and then back only once. Previously, navigating
back would trigger a navigation again in a timer.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242179 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

index bf84d6b..8f17c81 100644 (file)
@@ -1,3 +1,15 @@
+2019-02-27  Chris Dumez  <cdumez@apple.com>
+
+        Flaky API Test: TestWebKitAPI.ProcessSwap.NavigateToDataURLThenBack
+        https://bugs.webkit.org/show_bug.cgi?id=194545
+
+        Reviewed by Brady Eidson.
+
+        Make sure the test navigates forward and then back only once. Previously, navigating
+        back would trigger a navigation again in a timer.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
 2019-02-13  Ryan Haddad  <ryanhaddad@apple.com>
 
         High Sierra Debug JSC test queue should use faster hardware
index 9f18282..9e9ab8e 100644 (file)
@@ -3748,6 +3748,12 @@ TEST(ProcessSwap, NavigateToInvalidURL)
 static const char* navigateToDataURLThenBackBytes = R"PSONRESOURCE(
 <script>
 onpageshow = function(event) {
+    if (sessionStorage.getItem('navigated') == 'true') {
+        sessionStorage.clear();
+        return;
+    }
+    sessionStorage.setItem('navigated', 'true');
+
     // Location changes need to happen outside the onload handler to generate history entries.
     setTimeout(function() {
       window.location.href = "data:text/html,<body onload='history.back()'></body>";