Title: [258405] trunk/LayoutTests
Revision
258405
Author
cdu...@apple.com
Date
2020-03-13 10:14:59 -0700 (Fri, 13 Mar 2020)

Log Message

[ macOS ] fast/frames/sandboxed-iframe-navigation-allowed.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=206680
<rdar://problem/58840416>

Reviewed by Sam Weinig.

Make sure both iframes have finished loading before running the test. Previously, it was waiting for one of the
iframes to be loaded before doing the checks on both iframes. In some cases, the second iframe would not have
finished loading yet.

* fast/frames/sandboxed-iframe-navigation-allowed.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (258404 => 258405)


--- trunk/LayoutTests/ChangeLog	2020-03-13 17:05:23 UTC (rev 258404)
+++ trunk/LayoutTests/ChangeLog	2020-03-13 17:14:59 UTC (rev 258405)
@@ -1,3 +1,17 @@
+2020-03-13  Chris Dumez  <cdu...@apple.com>
+
+        [ macOS ] fast/frames/sandboxed-iframe-navigation-allowed.html is flaky failing
+        https://bugs.webkit.org/show_bug.cgi?id=206680
+        <rdar://problem/58840416>
+
+        Reviewed by Sam Weinig.
+
+        Make sure both iframes have finished loading before running the test. Previously, it was waiting for one of the
+        iframes to be loaded before doing the checks on both iframes. In some cases, the second iframe would not have
+        finished loading yet.
+
+        * fast/frames/sandboxed-iframe-navigation-allowed.html:
+
 2020-03-13  Jacob Uphoff  <jacob_uph...@apple.com>
 
         [ macOS ] webgpu/whlsl/uint-bitwise.html is flaky crashing

Modified: trunk/LayoutTests/fast/frames/sandboxed-iframe-navigation-allowed.html (258404 => 258405)


--- trunk/LayoutTests/fast/frames/sandboxed-iframe-navigation-allowed.html	2020-03-13 17:05:23 UTC (rev 258404)
+++ trunk/LayoutTests/fast/frames/sandboxed-iframe-navigation-allowed.html	2020-03-13 17:14:59 UTC (rev 258405)
@@ -1,15 +1,25 @@
 <html>
 <head>
-<script src=""
+<script src=""
 <script>
 
-if (window.testRunner) {
-    window.testRunner.dumpAsText();
-    window.testRunner.waitUntilDone();
+let isLoadComplete = false;
+let wasChildFrameWasNavigated = false;
+_onload_ = () => {
+    isLoadComplete = true;
+    if (wasChildFrameWasNavigated)
+        runTest();
 }
 
 function childFrameWasNavigated()
 {
+    wasChildFrameWasNavigated = true;
+    if (isLoadComplete)
+        runTest();
+}
+
+function runTest()
+{
     // Check that the child frame was unable to load a plugin, since its parent is sandboxed.
     shouldBeTrue("(self.sandboxedFrame.frameWithPlugin.document.getElementById('plugin').destroyStream) == undefined");
     
@@ -25,10 +35,7 @@
 function sandboxWasNavigated()
 {
     shouldBeEqualToString("String(document.getElementById('sandboxedFrameId').sandbox)", "allow-scripts allow-same-origin");
-    isSuccessfullyParsed();
-
-    if (window.testRunner)
-        window.testRunner.notifyDone();
+    finishJSTest();
 }
 
 </script>
@@ -50,6 +57,7 @@
     description("This test verifies that a sandboxed iframe CAN navigate both itself and a child in the frame tree. "
                 + "It also verifies that the sandbox attribute remains intact after a frame has been navigated, "
                 + "and that sandbox attributes are propagated through the frame hierarchy.");
+    jsTestIsAsync = true;
     </script>
 </body>
 </html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to