Title: [236164] trunk/LayoutTests
Revision
236164
Author
[email protected]
Date
2018-09-19 01:16:23 -0700 (Wed, 19 Sep 2018)

Log Message

http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=189710

Reviewed by Ryosuke Niwa.

Update the test to stop relying on the test page posting a message to the auxiliary window
to trigger a navigation. Instead, the auxiliary window now takes care of navigating itself
after it is loaded. This is more robust, especially considering that the test page is cross
origin and thus is not getting a load event for the auxiliary window.

* http/tests/navigation/resources/navigate-back-same-origin-helper.html: Added.
* http/tests/navigation/resources/navigate-helper.html: Removed.
* http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (236163 => 236164)


--- trunk/LayoutTests/ChangeLog	2018-09-19 08:11:04 UTC (rev 236163)
+++ trunk/LayoutTests/ChangeLog	2018-09-19 08:16:23 UTC (rev 236164)
@@ -1,3 +1,19 @@
+2018-09-19  Chris Dumez  <[email protected]>
+
+        http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=189710
+
+        Reviewed by Ryosuke Niwa.
+
+        Update the test to stop relying on the test page posting a message to the auxiliary window
+        to trigger a navigation. Instead, the auxiliary window now takes care of navigating itself
+        after it is loaded. This is more robust, especially considering that the test page is cross
+        origin and thus is not getting a load event for the auxiliary window.
+
+        * http/tests/navigation/resources/navigate-back-same-origin-helper.html: Added.
+        * http/tests/navigation/resources/navigate-helper.html: Removed.
+        * http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html:
+
 2018-09-19  Claudio Saavedra  <[email protected]>
 
         [WPE][GTK] Assorted gardening

Added: trunk/LayoutTests/http/tests/navigation/resources/navigate-back-same-origin-helper.html (0 => 236164)


--- trunk/LayoutTests/http/tests/navigation/resources/navigate-back-same-origin-helper.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/navigation/resources/navigate-back-same-origin-helper.html	2018-09-19 08:16:23 UTC (rev 236164)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script>
+_onload_ = () => {
+    setTimeout(() => {
+        window.location = "http://127.0.0.1:8000/navigation/resources/otherpage.html";
+    }, 0);
+};
+</script>
+</body>
+</html>

Deleted: trunk/LayoutTests/http/tests/navigation/resources/navigate-helper.html (236163 => 236164)


--- trunk/LayoutTests/http/tests/navigation/resources/navigate-helper.html	2018-09-19 08:11:04 UTC (rev 236163)
+++ trunk/LayoutTests/http/tests/navigation/resources/navigate-helper.html	2018-09-19 08:16:23 UTC (rev 236164)
@@ -1,12 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-<script>
-_onmessage_ = (msg) => {
-    setTimeout(() => {
-        window.location = msg.data.navigate;
-    }, 0);
-};
-</script>
-</body>
-</html>

Modified: trunk/LayoutTests/http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html (236163 => 236164)


--- trunk/LayoutTests/http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html	2018-09-19 08:11:04 UTC (rev 236163)
+++ trunk/LayoutTests/http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html	2018-09-19 08:16:23 UTC (rev 236164)
@@ -11,36 +11,18 @@
 if (window.testRunner)
     testRunner.setCanOpenWindows();
 
-function wasNavigatedSameOrigin()
-{
-    shouldBeEqualToString("w.location.href", "http://127.0.0.1:8000/navigation/resources/otherpage.html");
-    finishJSTest();
-}
-
-function wasNavigatedCrossOrigin()
-{
-    // Navigate back same origin.
-    w.postMessage({ navigate: "http://127.0.0.1:8000/navigation/resources/otherpage.html" }, "*");
-    handle = setInterval(() => {
-        try {
-            w.name;
-            clearInterval(handle);
-            wasNavigatedSameOrigin();
-        } catch(e) {
-        }
-    }, 10);
-}
-
 _onload_ = function() {
     w = window.open();
     w.opener = null;
-    w.location = "http://localhost:8000/navigation/resources/navigate-helper.html";
+    w.location = "http://localhost:8000/navigation/resources/navigate-back-same-origin-helper.html";
     handle = setInterval(() => {
         try {
-            w.name;
+            if (w.location.href != "about:blank") {
+                clearInterval(handle);
+                shouldBeEqualToString("w.location.href", "http://127.0.0.1:8000/navigation/resources/otherpage.html");
+                finishJSTest();
+            }
         } catch(e) {
-            clearInterval(handle);
-            wasNavigatedCrossOrigin();
         }
     }, 10);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to