Title: [211440] trunk/LayoutTests
Revision
211440
Author
[email protected]
Date
2017-01-31 10:59:23 -0800 (Tue, 31 Jan 2017)

Log Message

Unreviewed, fix layout tests added in r211435.

It is important that window.open() is called *after* testRunner.waitUntilDone()
has been called or you'll hit assertions in DRT.

* http/tests/security/cross-origin-window-open-insert-script.html:
* http/tests/security/cross-origin-window-open-_javascript_-url.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (211439 => 211440)


--- trunk/LayoutTests/ChangeLog	2017-01-31 18:57:57 UTC (rev 211439)
+++ trunk/LayoutTests/ChangeLog	2017-01-31 18:59:23 UTC (rev 211440)
@@ -1,3 +1,13 @@
+2017-01-31  Chris Dumez  <[email protected]>
+
+        Unreviewed, fix layout tests added in r211435.
+
+        It is important that window.open() is called *after* testRunner.waitUntilDone()
+        has been called or you'll hit assertions in DRT.
+
+        * http/tests/security/cross-origin-window-open-insert-script.html:
+        * http/tests/security/cross-origin-window-open-_javascript_-url.html:
+
 2017-01-31  Youenn Fablet  <[email protected]>
 
         RTCPeerConnection methods can take dictionaries as input

Modified: trunk/LayoutTests/http/tests/security/cross-origin-window-open-insert-script.html (211439 => 211440)


--- trunk/LayoutTests/http/tests/security/cross-origin-window-open-insert-script.html	2017-01-31 18:57:57 UTC (rev 211439)
+++ trunk/LayoutTests/http/tests/security/cross-origin-window-open-insert-script.html	2017-01-31 18:59:23 UTC (rev 211440)
@@ -12,35 +12,37 @@
     testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
-let win = open("about:blank", "one");
-let otherDocument = win.document;
-win.resultDiv = document.getElementById("resultDiv");
+window._onload_ = function() {
+    let win = open("about:blank", "one");
+    let otherDocument = win.document;
+    win.resultDiv = document.getElementById("resultDiv");
 
-let a = otherDocument.createElement("a");
-a.href = ""
-a.click();
+    let a = otherDocument.createElement("a");
+    a.href = ""
+    a.click();
 
-window.addEventListener('message', function(e) {
-    testFailed("Script executed in cross origin iframe");
-    testFailed("Retrieved cross-origin window's URL: " + e.data);
-});
+    window.addEventListener('message', function(e) {
+        testFailed("Script executed in cross origin iframe");
+        testFailed("Retrieved cross-origin window's URL: " + e.data);
+    });
 
-it = setInterval(function() {
-    try {
-        win.location.href;
-    } catch (e) {
-        // Window has navigated to cross origin URL.
-        clearInterval(it);
+    it = setInterval(function() {
         try {
-            var script = otherDocument.createElement("script");
-            script.innerText = "opener.postMessage(location.href, '*');";
-            otherDocument.body.append(script);
+            win.location.href;
         } catch (e) {
-            debug(e);
+            // Window has navigated to cross origin URL.
+            clearInterval(it);
+            try {
+                var script = otherDocument.createElement("script");
+                script.innerText = "opener.postMessage(location.href, '*');";
+                otherDocument.body.append(script);
+            } catch (e) {
+                debug(e);
+            }
+            setTimeout(finishJSTest, 0);
         }
-        setTimeout(finishJSTest, 0);
-    }
-}, 10);
+    }, 10);
+}
 </script>
 <script src=""
 </body>

Modified: trunk/LayoutTests/http/tests/security/cross-origin-window-open-_javascript_-url.html (211439 => 211440)


--- trunk/LayoutTests/http/tests/security/cross-origin-window-open-_javascript_-url.html	2017-01-31 18:57:57 UTC (rev 211439)
+++ trunk/LayoutTests/http/tests/security/cross-origin-window-open-_javascript_-url.html	2017-01-31 18:59:23 UTC (rev 211440)
@@ -12,35 +12,37 @@
     testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
 }
 
-let win = open("about:blank", "one");
-let otherDocument = win.document;
-win.resultDiv = document.getElementById("resultDiv");
+window._onload_ = function() {
+    let win = open("about:blank", "one");
+    let otherDocument = win.document;
+    win.resultDiv = document.getElementById("resultDiv");
 
-let a = otherDocument.createElement("a");
-a.href = ""
-a.click();
+    let a = otherDocument.createElement("a");
+    a.href = ""
+    a.click();
 
-window.addEventListener('message', function(e) {
-    testFailed("Script executed in cross origin iframe");
-    testFailed("Retrieved cross-origin window's URL: " + e.data);
-});
+    window.addEventListener('message', function(e) {
+        testFailed("Script executed in cross origin iframe");
+        testFailed("Retrieved cross-origin window's URL: " + e.data);
+    });
 
-it = setInterval(function() {
-    try {
-        win.location.href;
-    } catch (e) {
-        // Window has navigated to cross origin URL.
-        clearInterval(it);
+    it = setInterval(function() {
         try {
-            var frame = document.createElement("iframe");
-            frame.src = "" '*')"
-            otherDocument.body.append(frame);
+            win.location.href;
         } catch (e) {
-            debug(e);
+            // Window has navigated to cross origin URL.
+            clearInterval(it);
+            try {
+                var frame = document.createElement("iframe");
+                frame.src = "" '*')"
+                otherDocument.body.append(frame);
+            } catch (e) {
+                debug(e);
+            }
+            setTimeout(finishJSTest, 0);
         }
-        setTimeout(finishJSTest, 0);
-    }
-}, 10);
+    }, 10);
+}
 </script>
 <script src=""
 </body>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to