REGRESSION: Layout Test http/tests/security/location-cross-origin.html is a flaky...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2018 18:13:53 +0000 (18:13 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 May 2018 18:13:53 +0000 (18:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185259

Unreviewed, stop relying on a setImeout(100) and epect the frame navigation to have completed. Instead,
use a setInterval() to poll until the cross-origin frame has navigated.

* http/tests/security/location-cross-origin.html:

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

LayoutTests/ChangeLog
LayoutTests/http/tests/security/location-cross-origin.html

index c57160d..2238746 100644 (file)
@@ -1,3 +1,13 @@
+2018-05-03  Chris Dumez  <cdumez@apple.com>
+
+        REGRESSION: Layout Test http/tests/security/location-cross-origin.html is a flaky failure
+        https://bugs.webkit.org/show_bug.cgi?id=185259
+
+        Unreviewed, stop relying on a setImeout(100) and epect the frame navigation to have completed. Instead,
+        use a setInterval() to poll until the cross-origin frame has navigated.
+
+        * http/tests/security/location-cross-origin.html:
+
 2018-05-03  Miguel Gomez  <magomez@igalia.com>
 
         Unreviewed GTK+ gardening after r231300.
index 254010f..455c157 100644 (file)
@@ -60,10 +60,15 @@ onload = function() {
 
     // Setting 'href' cross origin should be allowed.
     shouldNotThrow("frames[0].location.href = 'about:blank'");
-    setTimeout(function() {
-        shouldBeEqualToString("frames[0].location.href", "about:blank");
-        finishJSTest();
-    }, 100);
+    handle = setInterval(function() {
+        try {
+            frames[0].location.href; // Should throw if still cross-origin.
+
+            shouldBeEqualToString("frames[0].location.href", "about:blank");
+            clearInterval(handle);
+            finishJSTest();
+        } catch (e) { }
+    }, 5);
 };
 </script>
 <script src="../../../resources/js-test-post.js"></script>