Title: [229371] trunk/LayoutTests
Revision
229371
Author
cdu...@apple.com
Date
2018-03-07 10:53:21 -0800 (Wed, 07 Mar 2018)

Log Message

http/tests/misc/location-replace-crossdomain.html is failing with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183408

Reviewed by Alex Christensen.

The test was trying to navigate a cross-origin iframe via location.replace() and checking
that the load succeeded in a setTimeout(1). There is no guarantee that the frame has loaded
by that point. We would normally rely on the 'load' event but it is not feasible here since
the iframe is cross-origin. Instead, I opted to have the iframe to a page that posts a
message to its parent window to indicate that the load has succeeded.

* http/tests/misc/location-replace-crossdomain-async-delegates-expected.txt: Added.
* http/tests/misc/location-replace-crossdomain-async-delegates.html: Added.
* http/tests/misc/location-replace-crossdomain-expected.txt: Added.
* http/tests/misc/location-replace-crossdomain.html:
* platform/gtk/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
* platform/ios/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
* platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
* platform/win/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (229370 => 229371)


--- trunk/LayoutTests/ChangeLog	2018-03-07 18:41:17 UTC (rev 229370)
+++ trunk/LayoutTests/ChangeLog	2018-03-07 18:53:21 UTC (rev 229371)
@@ -1,3 +1,25 @@
+2018-03-07  Chris Dumez  <cdu...@apple.com>
+
+        http/tests/misc/location-replace-crossdomain.html is failing with async policy delegates
+        https://bugs.webkit.org/show_bug.cgi?id=183408
+
+        Reviewed by Alex Christensen.
+
+        The test was trying to navigate a cross-origin iframe via location.replace() and checking
+        that the load succeeded in a setTimeout(1). There is no guarantee that the frame has loaded
+        by that point. We would normally rely on the 'load' event but it is not feasible here since
+        the iframe is cross-origin. Instead, I opted to have the iframe to a page that posts a
+        message to its parent window to indicate that the load has succeeded.
+
+        * http/tests/misc/location-replace-crossdomain-async-delegates-expected.txt: Added.
+        * http/tests/misc/location-replace-crossdomain-async-delegates.html: Added.
+        * http/tests/misc/location-replace-crossdomain-expected.txt: Added.
+        * http/tests/misc/location-replace-crossdomain.html:
+        * platform/gtk/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
+        * platform/ios/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
+        * platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
+        * platform/win/http/tests/misc/location-replace-crossdomain-expected.txt: Removed.
+
 2018-03-07  Per Arne Vollan  <pvol...@apple.com>
 
         Fix incorrect test expectations for http/wpt/resource-timing/rt-initiatorType-media.html.

Added: trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-async-delegates-expected.txt (0 => 229371)


--- trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-async-delegates-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-async-delegates-expected.txt	2018-03-07 18:53:21 UTC (rev 229371)
@@ -0,0 +1,11 @@
+Checks that a cross origin iframe can be navigated using location.replace().
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Navigated cross-origin frame via Location.replace
+PASS window.frames['crossDomainFrame'].location.href is "http://127.0.0.1:8000/security/resources/postMessage.html"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-async-delegates.html (0 => 229371)


--- trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-async-delegates.html	                        (rev 0)
+++ trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-async-delegates.html	2018-03-07 18:53:21 UTC (rev 229371)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+description("Checks that a cross origin iframe can be navigated using location.replace().");
+jsTestIsAsync = true;
+
+if (window.testRunner && testRunner.setShouldDecideNavigationPolicyAfterDelay) 
+    testRunner.setShouldDecideNavigationPolicyAfterDelay(true);
+
+_onload_ = function()
+{
+    addEventListener("message", function() {
+        testPassed("Navigated cross-origin frame via Location.replace");
+        shouldBeEqualToString("window.frames['crossDomainFrame'].location.href", "http://127.0.0.1:8000/security/resources/postMessage.html");
+        finishJSTest();
+    });
+    window.frames['crossDomainFrame'].location.replace("http://127.0.0.1:8000/security/resources/postMessage.html");
+    setTimeout(function() {
+        testFailed("Failed to navigate cross-origin frame via Location.replace");
+        finishJSTest();
+    }, 10000);
+}
+</script>
+<iframe id="crossDomainFrame" name="crossDomainFrame" src=""
+</body>
+</html>
+<!--     
+<rdar://problem/4808039> 
+http://bugs.webkit.org/show_bug.cgi?id=11230
+-->

Added: trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-expected.txt (0 => 229371)


--- trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:53:21 UTC (rev 229371)
@@ -0,0 +1,11 @@
+Checks that a cross origin iframe can be navigated using location.replace().
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Navigated cross-origin frame via Location.replace
+PASS window.frames['crossDomainFrame'].location.href is "http://127.0.0.1:8000/security/resources/postMessage.html"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/http/tests/misc/location-replace-crossdomain.html (229370 => 229371)


--- trunk/LayoutTests/http/tests/misc/location-replace-crossdomain.html	2018-03-07 18:41:17 UTC (rev 229370)
+++ trunk/LayoutTests/http/tests/misc/location-replace-crossdomain.html	2018-03-07 18:53:21 UTC (rev 229371)
@@ -1,19 +1,25 @@
+<!DOCTYPE html>
 <html>
-<head>
+<body>
+<script src=""
 <script>
-function test()
-{    
-    window.frames['crossDomainFrame'].location.replace("http://127.0.0.1:8000/misc/resources/success.html");
-    if (window.testRunner)
-        setTimeout("testRunner.notifyDone()", 1);
+description("Checks that a cross origin iframe can be navigated using location.replace().");
+jsTestIsAsync = true;
+
+_onload_ = function()
+{
+    addEventListener("message", function() {
+        testPassed("Navigated cross-origin frame via Location.replace");
+        shouldBeEqualToString("window.frames['crossDomainFrame'].location.href", "http://127.0.0.1:8000/security/resources/postMessage.html");
+        finishJSTest();
+    });
+    window.frames['crossDomainFrame'].location.replace("http://127.0.0.1:8000/security/resources/postMessage.html");
+    setTimeout(function() {
+        testFailed("Failed to navigate cross-origin frame via Location.replace");
+        finishJSTest();
+    }, 10000);
 }
-
-if (window.testRunner)
-    testRunner.waitUntilDone();
-    
 </script>
-</head>
-<body _onload_="test();">
 <iframe id="crossDomainFrame" name="crossDomainFrame" src=""
 </body>
 </html>

Deleted: trunk/LayoutTests/platform/gtk/http/tests/misc/location-replace-crossdomain-expected.txt (229370 => 229371)


--- trunk/LayoutTests/platform/gtk/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:41:17 UTC (rev 229370)
+++ trunk/LayoutTests/platform/gtk/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:53:21 UTC (rev 229371)
@@ -1,15 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
-        layer at (0,0) size 300x150
-          RenderView at (0,0) size 300x150
-        layer at (0,0) size 300x150
-          RenderBlock {HTML} at (0,0) size 300x150
-            RenderBody {BODY} at (8,8) size 284x134
-              RenderText {#text} at (0,0) size 71x17
-                text run at (0,0) width 71: "SUCCESS"
-      RenderText {#text} at (0,0) size 0x0
-      RenderText {#text} at (0,0) size 0x0

Deleted: trunk/LayoutTests/platform/ios/http/tests/misc/location-replace-crossdomain-expected.txt (229370 => 229371)


--- trunk/LayoutTests/platform/ios/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:41:17 UTC (rev 229370)
+++ trunk/LayoutTests/platform/ios/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:53:21 UTC (rev 229371)
@@ -1,15 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderPartObject {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
-        layer at (0,0) size 300x150
-          RenderView at (0,0) size 300x150
-        layer at (0,0) size 300x150
-          RenderBlock {HTML} at (0,0) size 300x150
-            RenderBody {BODY} at (8,8) size 284x134
-              RenderText {#text} at (0,0) size 70x19
-                text run at (0,0) width 70: "SUCCESS"
-      RenderText {#text} at (0,0) size 0x0
-      RenderText {#text} at (0,0) size 0x0

Deleted: trunk/LayoutTests/platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt (229370 => 229371)


--- trunk/LayoutTests/platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:41:17 UTC (rev 229370)
+++ trunk/LayoutTests/platform/mac/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:53:21 UTC (rev 229371)
@@ -1,15 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
-        layer at (0,0) size 300x150
-          RenderView at (0,0) size 300x150
-        layer at (0,0) size 300x150
-          RenderBlock {HTML} at (0,0) size 300x150
-            RenderBody {BODY} at (8,8) size 284x134
-              RenderText {#text} at (0,0) size 70x18
-                text run at (0,0) width 70: "SUCCESS"
-      RenderText {#text} at (0,0) size 0x0
-      RenderText {#text} at (0,0) size 0x0

Deleted: trunk/LayoutTests/platform/win/http/tests/misc/location-replace-crossdomain-expected.txt (229370 => 229371)


--- trunk/LayoutTests/platform/win/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:41:17 UTC (rev 229370)
+++ trunk/LayoutTests/platform/win/http/tests/misc/location-replace-crossdomain-expected.txt	2018-03-07 18:53:21 UTC (rev 229371)
@@ -1,15 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderIFrame {IFRAME} at (0,0) size 304x154 [border: (2px inset #000000)]
-        layer at (0,0) size 300x150
-          RenderView at (0,0) size 300x150
-        layer at (0,0) size 300x150
-          RenderBlock {HTML} at (0,0) size 300x150
-            RenderBody {BODY} at (8,8) size 284x134
-              RenderText {#text} at (0,0) size 71x18
-                text run at (0,0) width 71: "SUCCESS"
-      RenderText {#text} at (0,0) size 0x0
-      RenderText {#text} at (0,0) size 0x0
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to