Rubber-stamped by Maciej.
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Dec 2007 08:28:13 +0000 (08:28 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Dec 2007 08:28:13 +0000 (08:28 +0000)
        - Change more tests to use the new layoutTestController.globalFlag style polling instead
          of the "flag frame hack".

        * http/tests/security/cross-frame-access-parent-explicit-domain-expected.txt:
        * http/tests/security/cross-frame-access-port-expected.txt:
        * http/tests/security/cross-frame-access-private-browsing-expected.txt:
        * http/tests/security/cross-frame-access-protocol-expected.txt:
        * http/tests/security/dataURL/xss-DENIED-to-data-url-from-data-url.html:
        * http/tests/security/host-compare-case-insensitive-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode.html:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS-expected.txt:
        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS.html:
        * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-iframe.html:
        * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-opened-frame.html:
        * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-iframe.html:
        * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-opened-frame.html:
        * http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level.html:
        * http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-window-open.html:
        * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe-expected.txt:
        * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe.html:
        * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open-expected.txt:
        * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open.html:
        * http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-subframe-expected.txt:
        * http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-subframe.html:
        * http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-window-open.html:
        * http/tests/security/protocol-compare-case-insensitive-expected.txt:
        * http/tests/security/resources/cross-frame-iframe.html:

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

48 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/security/cross-frame-access-parent-explicit-domain-expected.txt
LayoutTests/http/tests/security/cross-frame-access-port-expected.txt
LayoutTests/http/tests/security/cross-frame-access-private-browsing-expected.txt
LayoutTests/http/tests/security/cross-frame-access-protocol-expected.txt
LayoutTests/http/tests/security/dataURL/xss-DENIED-to-data-url-from-data-url.html
LayoutTests/http/tests/security/host-compare-case-insensitive-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode.html
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS-expected.txt
LayoutTests/http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS.html
LayoutTests/http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-iframe.html
LayoutTests/http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-opened-frame.html
LayoutTests/http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-iframe.html
LayoutTests/http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-opened-frame.html
LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level.html
LayoutTests/http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-window-open.html
LayoutTests/http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe-expected.txt
LayoutTests/http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe.html
LayoutTests/http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open-expected.txt
LayoutTests/http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open.html
LayoutTests/http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-subframe-expected.txt
LayoutTests/http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-subframe.html
LayoutTests/http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-window-open.html
LayoutTests/http/tests/security/protocol-compare-case-insensitive-expected.txt
LayoutTests/http/tests/security/resources/cross-frame-iframe.html

index 329a23610232a69b79969026e35f26819d01bbdd..f4390c3eaa5e6d1f98a01435199546c6751a78fc 100644 (file)
@@ -1,3 +1,58 @@
+2007-12-27  Sam Weinig  <sam@webkit.org>
+
+        Rubber-stamped by Maciej.
+
+        - Change more tests to use the new layoutTestController.globalFlag style polling instead
+          of the "flag frame hack".
+
+        * http/tests/security/cross-frame-access-parent-explicit-domain-expected.txt:
+        * http/tests/security/cross-frame-access-port-expected.txt:
+        * http/tests/security/cross-frame-access-private-browsing-expected.txt:
+        * http/tests/security/cross-frame-access-protocol-expected.txt:
+        * http/tests/security/dataURL/xss-DENIED-to-data-url-from-data-url.html:
+        * http/tests/security/host-compare-case-insensitive-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-location-htmldom.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-getAttribute-value.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-htmldom.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttribute.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNS.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNode.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-frame-src-setAttributeNodeNS.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-getAttribute-value.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-htmldom.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttribute.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNS.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNode.html:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS-expected.txt:
+        * http/tests/security/javascriptURL/javascriptURL-execution-context-iframe-src-setAttributeNodeNS.html:
+        * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-iframe.html:
+        * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-opened-frame.html:
+        * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-iframe.html:
+        * http/tests/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-opened-frame.html:
+        * http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-sub-frame-2-level.html:
+        * http/tests/security/javascriptURL/xss-ALLOWED-to-javascript-url-window-open.html:
+        * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe-expected.txt:
+        * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe.html:
+        * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open-expected.txt:
+        * http/tests/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open.html:
+        * http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-subframe-expected.txt:
+        * http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-subframe.html:
+        * http/tests/security/javascriptURL/xss-DENIED-to-javascript-url-in-foreign-domain-window-open.html:
+        * http/tests/security/protocol-compare-case-insensitive-expected.txt:
+        * http/tests/security/resources/cross-frame-iframe.html:
+
 2007-12-27  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Maciej.
index 2a065f1744d97c6f8bbfe479a20c7812672b8451..f249867aafae917e517022996a02be12196d7ca6 100644 (file)
@@ -8,10 +8,3 @@ PASS: Cross frame access from frame explicitly setting document.domain was denie
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index 09e79ebb45b21a89bddb1e60464b1c8b36f1d2ce..6f6b52ba4ffe40b04cbf08c0281a0c958f8ca2cb 100644 (file)
@@ -8,10 +8,3 @@ PASS: Cross frame access to different port was denied!
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index 1b82a4ac52195e03f48f0ee361e741227ba4450a..0e18b65ff6a798180301e8331cff64881f5679cf 100644 (file)
@@ -8,10 +8,3 @@ Attempting to violate the same-origin policy with private browsing enabled.  If
 Frame: '<!--framePath //<!--frame0-->-->'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index bceb34352c961fece9a7a2b37afd59ccf8488f4f..5052421825ef7df01e0504a1bbffadb1245ad707 100644 (file)
@@ -8,10 +8,3 @@ PASS: Cross frame access to https from http was denied!
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index 8385954deb10c1fc6afed1c74aaad92d84db76ca..4a928f015eb9eac7d2088e47cc8bb63423369289 100644 (file)
@@ -1,8 +1,5 @@
 <html>
-<body>
-    <p>This tests that a data: URL loaded in an iframe inside another data: URL loaded iframe doesn't have access to its parent, the 
-        first data: URL loaded iframe.</p>
-    <iframe id="aFrame" style="width: 500px; height: 300px;"></iframe>
+<head>
     <script>
         if (window.layoutTestController) {
             layoutTestController.dumpAsText();
             layoutTestController.waitUntilDone();
         }
 
-        var innerURL = "data:text/html,<html>"
-            + "<head>"
-            +     "<scr" + "ipt>"
-            +         "function test() {"
-            +             "try {"
-            +                 "parent.document.getElementById(\"accessMe\").innerHTML = \"FAIL: Cross frame access from a data: URL was allowed.\";"
-            +             "} catch (e) {"
-            +             "}"
-            +             "if (window.layoutTestController)"
-            +                 "layoutTestController.notifyDone();"
-            +         "}"
-            +     "</scr" + "ipt>"
-            + "</head>"        
-            + "<body onload=\"test();\">"
-            +     "<p>Inner-inner iframe.</p>"
-            + "</body>"
-            + "</html>";
+        window.onload = function()
+        {
+            var innerURL = "data:text/html,<html>"
+                + "<head>"
+                +     "<scr" + "ipt>"
+                +         "function test() {"
+                +             "try {"
+                +                 "parent.document.getElementById(\"accessMe\").innerHTML = \"FAIL: Cross frame access from a data: URL was allowed.\";"
+                +             "} catch (e) {"
+                +             "}"
+                +             "if (window.layoutTestController)"
+                +                 "layoutTestController.notifyDone();"
+                +         "}"
+                +     "</scr" + "ipt>"
+                + "</head>"        
+                + "<body onload=\"test();\">"
+                +     "<p>Inner-inner iframe.</p>"
+                + "</body>"
+                + "</html>";
 
-        var url = "data:text/html,<html>"
-            + "<body>"
-            +     "<p id='accessMe'>PASS: Cross frame access from a data: URL was denied.</p>"
-            +     "<p>Inner iframe.</p>"
-            +     "<iframe name='innerFrame' id='innerFrame' src='" + innerURL + "'></iframe>"
-            + "</body>"
-            + "</html>";
+            var url = "data:text/html,<html>"
+                + "<body>"
+                +     "<p id='accessMe'>PASS: Cross frame access from a data: URL was denied.</p>"
+                +     "<p>Inner iframe.</p>"
+                +     "<iframe name='innerFrame' id='innerFrame' src='" + innerURL + "'></iframe>"
+                + "</body>"
+                + "</html>";
 
-        var iframe = document.getElementById("aFrame");
-        iframe.src = url;
+            var iframe = document.getElementById("aFrame");
+            iframe.src = url;
+        }
     </script>
+</head>
+<body>
+    <p>This tests that a data: URL loaded in an iframe inside another data: URL loaded iframe doesn't have access to its parent, the 
+        first data: URL loaded iframe.</p>
+    <iframe id="aFrame" style="width: 500px; height: 300px;"></iframe>
 </body>
 </html>
index 20b9ce83e45d6f912a9e6a8d1363e2a8627dda6d..c60a6a57d843cc283db3a9e2194fd486b4741130 100644 (file)
@@ -9,13 +9,6 @@ PASS: Host name compare is case insensitive.
 
 Inner iframe.
 
-
-
---------
-Frame: 'flag'
---------
-
-
 --------
 Frame: 'frameB'
 --------
index 0177fb34b0ab41dc94051dce376915186c24da08..95ff0f4eeb1bc446d5dfc47f3efaab1b59b5a16f 100644 (file)
@@ -11,10 +11,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index e81a2d3b97b9d77713ba3d19b07f3b6d20edda22..ba9aaccc504e25a301b2434993627736ba5cb6f2 100644 (file)
@@ -1,42 +1,38 @@
 <html>
 <head>
     <script>
-        function runTest() {
+        window.onload = function()
+        {
             if (window.layoutTestController) {
                 layoutTestController.dumpAsText();
                 layoutTestController.dumpChildFramesAsText();
                 layoutTestController.waitUntilDone();
             }
 
-            var innerFrame = document.getElementById('aFrame').contentWindow;
-            var testDone = false;
-
-            setTimeout(test, 1);
-
-            setTimeout(function() {
-                if (!testDone) {
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                }
-            }, 2000);
-
-            function test() {
-                var flag = innerFrame.frames[0];
-                if (!flag) {
-                    setTimeout(test, 1);
-                    return;
-                }
-
-                document.getElementById('aFrame').location = 'javascript:"FAIL: this should not have been loaded."';
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                alert("This test requires it be run in DRT.");
+            }
+        }
 
-                testDone = true;
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
+                return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
+
+        runTest = function()
+        {
+            document.getElementById('aFrame').location = 'javascript:"FAIL: this should not have been loaded."';
         }
     </script>
 </head>
-<frameset onload="runTest()" rows="10%,*">
+<frameset rows="10%,*">
     <frame id='main' src="data:text/html,<p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the frame below.</p>">
     <frame id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'>
 </frameset>
index 491a6d0ac6aaa3dd464d672056faf519c3499b77..ae3dc9365e2ee43c325cd41ef68e665ee18df9f4 100644 (file)
@@ -1,44 +1,40 @@
 <html>
 <head>
     <script>
-        function runTest() {
+        window.onload = function()
+        {
             if (window.layoutTestController) {
                 layoutTestController.dumpAsText();
                 layoutTestController.dumpChildFramesAsText();
                 layoutTestController.waitUntilDone();
             }
 
-            var innerFrame = document.getElementById('aFrame').contentWindow;
-            var testDone = false;
-
-            setTimeout(test, 1);
-
-            setTimeout(function() {
-                if (!testDone) {
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                }
-            }, 2000);
-
-            function test() {
-                var flag = innerFrame.frames[0];
-                if (!flag) {
-                    setTimeout(test, 1);
-                    return;
-                }
-
-                // Get old Attribute node and use Attribute.value.
-                var oldSrc = document.getElementById('aFrame').getAttributeNode('src');
-                oldSrc.value = 'javascript:"FAIL: this should not have been loaded."';
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                alert("This test requires it be run in DRT.");
+            }
+        }
 
-                testDone = true;
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
+                return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
+
+        runTest = function()
+        {
+            // Get old Attribute node and use Attribute.value.
+            var oldSrc = document.getElementById('aFrame').getAttributeNode('src');
+            oldSrc.value = 'javascript:"FAIL: this should not have been loaded."';
         }
     </script>
 </head>
-<frameset onload="runTest()" rows="10%,*">
+<frameset rows="10%,*">
     <frame id='main' src="data:text/html,<p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the frame below.</p>">
     <frame id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'>
 </frameset>
index 4fed5110caa7d28ff2935f764b025a31f74f5ab4..67281d262bfcd73b5da9902a9e7f15edb0e185ca 100644 (file)
@@ -11,10 +11,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index 056c6cb88db084693d2c5812cfa35c7114d0329e..3130d22f648275c46cf8b4575e3fca33e61752ce 100644 (file)
@@ -1,42 +1,38 @@
 <html>
 <head>
     <script>
-        function runTest() {
+        window.onload = function()
+        {
             if (window.layoutTestController) {
                 layoutTestController.dumpAsText();
                 layoutTestController.dumpChildFramesAsText();
                 layoutTestController.waitUntilDone();
             }
 
-            var innerFrame = document.getElementById('aFrame').contentWindow;
-            var testDone = false;
-
-            setTimeout(test, 1);
-
-            setTimeout(function() {
-                if (!testDone) {
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                }
-            }, 2000);
-
-            function test() {
-                var flag = innerFrame.frames[0];
-                if (!flag) {
-                    setTimeout(test, 1);
-                    return;
-                }
-
-                document.getElementById('aFrame').src = 'javascript:"FAIL: this should not have been loaded."';
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                alert("This test requires it be run in DRT.");
+            }
+        }
 
-                testDone = true;
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
+                return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
+
+        runTest = function()
+        {
+            document.getElementById('aFrame').src = 'javascript:"FAIL: this should not have been loaded."';
         }
     </script>
 </head>
-<frameset onload="runTest()" rows="10%,*">
+<frameset rows="10%,*">
     <frame id='main' src="data:text/html,<p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the frame below.</p>">
     <frame id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'>
 </frameset>
index 5014694835e4b8796aac31ea0279b88d2f3118bc..ced0acaaeb04a1b1e468f5c67b5f059051101c03 100644 (file)
@@ -11,10 +11,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index cc05233ed2d8b3d5c55ab3604f4034f452a78165..3df603eed5dee129f92c54dc9014b6a6a9d8fc89 100644 (file)
@@ -1,42 +1,38 @@
 <html>
 <head>
     <script>
-        function runTest() {
+        window.onload = function()
+        {
             if (window.layoutTestController) {
                 layoutTestController.dumpAsText();
                 layoutTestController.dumpChildFramesAsText();
                 layoutTestController.waitUntilDone();
             }
 
-            var innerFrame = document.getElementById('aFrame').contentWindow;
-            var testDone = false;
-
-            setTimeout(test, 1);
-
-            setTimeout(function() {
-                if (!testDone) {
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                }
-            }, 2000);
-
-            function test() {
-                var flag = innerFrame.frames[0];
-                if (!flag) {
-                    setTimeout(test, 1);
-                    return;
-                }
-
-                document.getElementById('aFrame').setAttribute("src", 'javascript:"FAIL: this should not have been loaded."');
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                alert("This test requires it be run in DRT.");
+            }
+        }
 
-                testDone = true;
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
+                return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
+
+        runTest = function()
+        {
+            document.getElementById('aFrame').setAttribute("src", 'javascript:"FAIL: this should not have been loaded."');
         }
     </script>
 </head>
-<frameset onload="runTest()" rows="10%,*">
+<frameset rows="10%,*">
     <frame id='main' src="data:text/html,<p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the frame below.</p>">
     <frame id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'>
 </frameset>
index 480984a55a804d5e47e7e970c7fa456debf68289..a4769d3ee86f7afea9500bb909adf59c76bed745 100644 (file)
@@ -11,10 +11,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index 5647fd84b2301be216fdc084a496a7f618e7d8dc..c1a287af01af93ceeba28df7ccb7147df5ecb3ab 100644 (file)
@@ -1,42 +1,38 @@
 <html>
 <head>
     <script>
-        function runTest() {
+        window.onload = function()
+        {
             if (window.layoutTestController) {
                 layoutTestController.dumpAsText();
                 layoutTestController.dumpChildFramesAsText();
                 layoutTestController.waitUntilDone();
             }
 
-            var innerFrame = document.getElementById('aFrame').contentWindow;
-            var testDone = false;
-
-            setTimeout(test, 1);
-
-            setTimeout(function() {
-                if (!testDone) {
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                }
-            }, 2000);
-
-            function test() {
-                var flag = innerFrame.frames[0];
-                if (!flag) {
-                    setTimeout(test, 1);
-                    return;
-                }
-
-                document.getElementById('aFrame').setAttributeNS(null, "src", 'javascript:"FAIL: this should not have been loaded."');
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                alert("This test requires it be run in DRT.");
+            }
+        }
 
-                testDone = true;
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
+                return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
+
+        runTest = function()
+        {
+            document.getElementById('aFrame').setAttributeNS(null, "src", 'javascript:"FAIL: this should not have been loaded."');
         }
     </script>
 </head>
-<frameset onload="runTest()" rows="10%,*">
+<frameset rows="10%,*">
     <frame id='main' src="data:text/html,<p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the frame below.</p>">
     <frame id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'>
 </frameset>
index 42791b2365a7231eb9ff592b7d837f36af79df72..fc5aea44fa4a9d8c0a46ea0fc4e12eac3f9bf094 100644 (file)
@@ -11,10 +11,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index f82ea4032a1202a0060eac403b86cd5be19eb838..e00427b24e7f2f05e328570c29438764fc0957b8 100644 (file)
@@ -1,44 +1,40 @@
 <html>
 <head>
     <script>
-        function runTest() {
+        window.onload = function()
+        {
             if (window.layoutTestController) {
                 layoutTestController.dumpAsText();
                 layoutTestController.dumpChildFramesAsText();
                 layoutTestController.waitUntilDone();
             }
 
-            var innerFrame = document.getElementById('aFrame').contentWindow;
-            var testDone = false;
-
-            setTimeout(test, 1);
-
-            setTimeout(function() {
-                if (!testDone) {
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                }
-            }, 2000);
-
-            function test() {
-                var flag = innerFrame.frames[0];
-                if (!flag) {
-                    setTimeout(test, 1);
-                    return;
-                }
-
-                var newSrc = document.createAttribute("src");
-                newSrc.value = 'javascript:"FAIL: this should not have been loaded."';
-                document.getElementById('aFrame').setAttributeNode(newSrc);
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                alert("This test requires it be run in DRT.");
+            }
+        }
 
-                testDone = true;
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
+                return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
+
+        runTest = function()
+        {
+            var newSrc = document.createAttribute("src");
+            newSrc.value = 'javascript:"FAIL: this should not have been loaded."';
+            document.getElementById('aFrame').setAttributeNode(newSrc);
         }
     </script>
 </head>
-<frameset onload="runTest()" rows="10%,*">
+<frameset rows="10%,*">
     <frame id='main' src="data:text/html,<p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the frame below.</p>">
     <frame id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'>
 </frameset>
index 73a386f52bbb91da392fac81b637be8c4e5725c1..6122ad56959afbde15dc4e49ef620a90bf5acec3 100644 (file)
@@ -1,44 +1,40 @@
 <html>
 <head>
     <script>
-        function runTest() {
+        window.onload = function()
+        {
             if (window.layoutTestController) {
                 layoutTestController.dumpAsText();
                 layoutTestController.dumpChildFramesAsText();
                 layoutTestController.waitUntilDone();
             }
 
-            var innerFrame = document.getElementById('aFrame').contentWindow;
-            var testDone = false;
-
-            setTimeout(test, 1);
-
-            setTimeout(function() {
-                if (!testDone) {
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                }
-            }, 2000);
-
-            function test() {
-                var flag = innerFrame.frames[0];
-                if (!flag) {
-                    setTimeout(test, 1);
-                    return;
-                }
-
-                var newSrc = document.createAttribute("src");
-                newSrc.value = 'javascript:"FAIL: this should not have been loaded."';
-                document.getElementById('aFrame').setAttributeNodeNS(newSrc);
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                alert("This test requires it be run in DRT.");
+            }
+        }
 
-                testDone = true;
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
+                return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
+
+        runTest = function()
+        {
+            var newSrc = document.createAttribute("src");
+            newSrc.value = 'javascript:"FAIL: this should not have been loaded."';
+            document.getElementById('aFrame').setAttributeNodeNS(newSrc);
         }
     </script>
 </head>
-<frameset onload="runTest()" rows="10%,*">
+<frameset rows="10%,*">
     <frame id='main' src="data:text/html,<p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the frame below.</p>">
     <frame id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'>
 </frameset>
index 279d9db26e0c53da04cc687ecb9ecd4732144971..8ce644494c52e7ba5307d0094f2ae62c25e0c5cb 100644 (file)
@@ -1,47 +1,47 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
-    <pre id='console'></pre>
-    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.dumpChildFramesAsText();
-            layoutTestController.waitUntilDone();
-        }
-
-        var innerFrame = window.frames[0];
-
-        var testDone = false;
-
-        setTimeout(test, 1);
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.dumpChildFramesAsText();
+                layoutTestController.waitUntilDone();
+            }
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
-        }, 2000);
+        }
 
-        function test() {
-            var flag = innerFrame.frames[0];
-            if (!flag) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
 
+        runTest = function()
+        {
             // Get old Attribute node and use Attribute.value.
             var oldSrc = document.getElementById('aFrame').getAttributeNode('src');
             oldSrc.value = 'javascript:"FAIL: this should not have been loaded."';
-
-            testDone = true;
-            if (window.layoutTestController)
-                layoutTestController.notifyDone();
         }
     </script>
+</head>
+<body>
+    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
+    <pre id='console'></pre>
+    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
 </body>
 </html>
index 770545edcfd4ebb0c1de854357ac301ed4828269..1713f035d08ffa0f467c56304bd8154bb41d1241 100644 (file)
@@ -8,10 +8,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index dedbef42ea4588acbfe52d87f9d157d8e434730b..0509bbd82d464983b6867aa6ed75c0c353dc2f7d 100644 (file)
@@ -1,45 +1,45 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
-    <pre id='console'></pre>
-    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.dumpChildFramesAsText();
-            layoutTestController.waitUntilDone();
-        }
-
-        var innerFrame = window.frames[0];
-
-        var testDone = false;
-
-        setTimeout(test, 1);
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.dumpChildFramesAsText();
+                layoutTestController.waitUntilDone();
+            }
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
-        }, 2000);
+        }
 
-        function test() {
-            var flag = innerFrame.frames[0];
-            if (!flag) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
 
+        runTest = function()
+        {
             document.getElementById('aFrame').src = 'javascript:"FAIL: this should not have been loaded."';
-
-            testDone = true;
-            if (window.layoutTestController)
-                layoutTestController.notifyDone();
         }
     </script>
+</head>
+<body>
+    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
+    <pre id='console'></pre>
+    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
 </body>
 </html>
index 6f1734a4060e11106c146b6b6aaeb37698fa6f7a..8d3bdcc063eb50ec4806989130eaca405c1402b3 100644 (file)
@@ -8,10 +8,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index fbfb440afc02ca7ee174d5e23d383c0620c272a5..afc10f69dd03639831190c9de60dd31baa4cf2b6 100644 (file)
@@ -1,45 +1,45 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
-    <pre id='console'></pre>
-    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.dumpChildFramesAsText();
-            layoutTestController.waitUntilDone();
-        }
-
-        var innerFrame = window.frames[0];
-
-        var testDone = false;
-
-        setTimeout(test, 1);
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.dumpChildFramesAsText();
+                layoutTestController.waitUntilDone();
+            }
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
-        }, 2000);
+        }
 
-        function test() {
-            var flag = innerFrame.frames[0];
-            if (!flag) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
 
+        runTest = function()
+        {
             document.getElementById('aFrame').setAttribute("src", 'javascript:"FAIL: this should not have been loaded."');
-
-            testDone = true;
-            if (window.layoutTestController)
-                layoutTestController.notifyDone();
         }
     </script>
+</head>
+<body>
+    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
+    <pre id='console'></pre>
+    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
 </body>
 </html>
index 5273381fd159689ae0a2ba7088368af0747ef145..98f28d473a324e0b033d2323ed01ac4b12e83bfd 100644 (file)
@@ -8,10 +8,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index 21b52567de8bef3194c2d79356c9a9c75c37c32e..958a099b4aaf5422e8ba0f1d61c058e2448f0864 100644 (file)
@@ -1,45 +1,45 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
-    <pre id='console'></pre>
-    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.dumpChildFramesAsText();
-            layoutTestController.waitUntilDone();
-        }
-
-        var innerFrame = window.frames[0];
-
-        var testDone = false;
-
-        setTimeout(test, 1);
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.dumpChildFramesAsText();
+                layoutTestController.waitUntilDone();
+            }
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
-        }, 2000);
+        }
 
-        function test() {
-            var flag = innerFrame.frames[0];
-            if (!flag) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
 
+        runTest = function()
+        {
             document.getElementById('aFrame').setAttributeNS(null, "src", 'javascript:"FAIL: this should not have been loaded."');
-
-            testDone = true;
-            if (window.layoutTestController)
-                layoutTestController.notifyDone();
         }
     </script>
+</head>
+<body>
+    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
+    <pre id='console'></pre>
+    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
 </body>
 </html>
index 5a94bcf4fc3e4543c920323e3cda856cedce062c..ffb0fc0f1f2b5a406d1e6f2466feb28d0cdd81a7 100644 (file)
@@ -8,10 +8,3 @@ This test passes as long as the word 'FAIL' and an accompanying message do not a
 Frame: 'aFrame'
 --------
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index 024ef3fc20da3300fbc13686edb385f8086f2d09..62e7aa55307c2bded772e0b2d116480c386f5321 100644 (file)
@@ -1,47 +1,47 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
-    <pre id='console'></pre>
-    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.dumpChildFramesAsText();
-            layoutTestController.waitUntilDone();
-        }
-
-        var innerFrame = window.frames[0];
-
-        var testDone = false;
-
-        setTimeout(test, 1);
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.dumpChildFramesAsText();
+                layoutTestController.waitUntilDone();
+            }
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
-        }, 2000);
+        }
 
-        function test() {
-            var flag = innerFrame.frames[0];
-            if (!flag) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
 
+        runTest = function()
+        {
             var newSrc = document.createAttribute("src");
             newSrc.value = 'javascript:"FAIL: this should not have been loaded."';
             document.getElementById('aFrame').setAttributeNode(newSrc);
-
-            testDone = true;
-            if (window.layoutTestController)
-                layoutTestController.notifyDone();
         }
     </script>
+</head>
+<body>
+    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
+    <pre id='console'></pre>
+    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
 </body>
 </html>
index ce0b30bfe6c9cd3210323f85ddd27bf53776454b..f25d8466414bf4b972303f8198a399f8de321624 100644 (file)
@@ -1,47 +1,47 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
-    <pre id='console'></pre>
-    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.dumpChildFramesAsText();
-            layoutTestController.waitUntilDone();
-        }
-
-        var innerFrame = window.frames[0];
-
-        var testDone = false;
-
-        setTimeout(test, 1);
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.dumpChildFramesAsText();
+                layoutTestController.waitUntilDone();
+            }
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
-        }, 2000);
+        }
 
-        function test() {
-            var flag = innerFrame.frames[0];
-            if (!flag) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
 
+        runTest = function()
+        {
             var newSrc = document.createAttribute("src");
             newSrc.value = 'javascript:"FAIL: this should not have been loaded."';
             document.getElementById('aFrame').setAttributeNodeNS(newSrc);
-
-            testDone = true;
-            if (window.layoutTestController)
-                layoutTestController.notifyDone();
         }
     </script>
+</head>
+<body>
+    <p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
+    <pre id='console'></pre>
+    <iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
 </body>
 </html>
index 664f7283ad06d42913bf5fe2dc9aa166e52c4887..5499d8ced9bdeb80f9903532da0bd376cc3281ba 100644 (file)
@@ -4,11 +4,19 @@
     <iframe id="aFrame"></iframe>
     <script>
         var url = "javascript:\"<html>"
+            + "<head>"
+            +     "<scr" + "ipt>"
+            +         "window.onload = function()"
+            +         "{"
+            +             "if (window.layoutTestController)"
+            +                 "layoutTestController.globalFlag = true;"
+            +         "}"
+            +     "</scr" + "ipt>"
+            + "</head>"
             + "<body>"
             +     "<p id='accessMe'>PASS: Cross frame access from a frame on a foreign domain denied!</p>"
             +     "<p>Inner-inner iframe. This iframe (which is javascript: URL and whose parent is on a foreign domain) is the frame that the"
             +     " main frame is trying to access.  It should not have access to it.</p>"
-            +     "<iframe name='flag' id='flag'></iframe>"
             + "</body>"
             + "</html>\"";
 
index d49145f91596efc05a55895aeb50b8a6f8cb1d04..e8f22531fe27175e0334f554c38e9720de439da5 100644 (file)
@@ -4,11 +4,19 @@
     <iframe id="aFrame"></iframe>
     <script>
         var url = "javascript:\"<html>"
+            + "<head>"
+            +     "<scr" + "ipt>"
+            +         "window.onload = function()"
+            +         "{"
+            +             "if (window.layoutTestController)"
+            +                 "layoutTestController.globalFlag = true;"
+            +         "}"
+            +     "</scr" + "ipt>"
+            + "</head>"
             + "<body>"
             +     "<p id='accessMe'>PASS: Access from the main frame was denied!</p>"
             +     "<p>Inner-inner iframe. This iframe (which is javascript: URL and whose parent is on a foreign domain) is the frame that the"
             +     " main frame is trying to access.  It should not have access to it.</p>"
-            +     "<iframe id='flag'></iframe>"
             + "</body>"
             + "</html>\"";
 
index ae1a14de823d63e84f3e8412c743d756f699f498..cefdcc03056673468ed76deb2e10cea49cf93840 100644 (file)
@@ -4,9 +4,19 @@
     <iframe id="aFrame"></iframe>
     <script>
         var url = "javascript:\"<html>"
-            + "<scr" + "ipt>"
-            +     "top.document.getElementById('accessMe').innerHTML = 'FAIL: Cross frame access from a javascript: URL on a different domain was allowed';"
-            + "</scri" + "pt>"
+            + "<head>"
+            +     "<scr" + "ipt>"
+            +         "window.onload = function()"
+            +         "{"
+            +             "try {"
+            +                 "top.document.getElementById('accessMe').innerHTML = 'FAIL: Cross frame access from a javascript: URL on a different domain was allowed';"
+            +             "} catch (e) {"
+            +             "}"
+            +             "if (window.layoutTestController)"
+            +                 "layoutTestController.notifyDone();"
+            +         "}"
+            +     "</scr" + "ipt>"
+            + "</head>"
             + "<body>"
             +     "<p>Inner-inner iframe. This iframe (which is javascript: URL and whose parent is on a foreign domain) is the frame attempting to access"
             +     " the main frame.  It should not have access to it.</p>"
index 560b28ed173f0100c1fac034f4cd3a81905f39b3..2370fa5c1ee73e528e487c3530adef913455be6b 100644 (file)
@@ -4,13 +4,22 @@
     <iframe name='aFrame' id="aFrame"></iframe>
     <script>
         var url = "javascript:\"<html>"
+            + "<head>"
+            +     "<scr" + "ipt>"
+            +         "window.onload = function()"
+            +         "{"
+            +             "try {"
+            +                 "parent.opener.document.getElementById('accessMe').innerHTML = 'FAIL: Cross frame access from a javascript: URL on a different domain was allowed';"
+            +             "} catch(e) {"
+            +             "}"
+            +             "if (window.layoutTestController)"
+            +                 "layoutTestController.globalFlag = true;"
+            +         "}"
+            +     "</scr" + "ipt>"
+            + "</head>"
             + "<body>"
             +     "<p>Inner-inner iframe. This iframe (which is javascript: URL and whose parent is on a foreign domain) is the frame attempting to access"
             +     " the main frame.  It should not have access to it.</p>"
-            +     "<iframe name='flag' id='flag'></iframe>"
-            +     "<scr" + "ipt>"
-            +         "parent.opener.document.getElementById('accessMe').innerHTML = 'FAIL: Cross frame access from a javascript: URL on a different domain was allowed';"
-            +     "</scri" + "pt>"
             + "</body>"
             + "</html>\"";
 
index bffd6a159a35049d83199f94b762ab2625d620c7..0861921892268d047d76976127d5f719196c6467 100644 (file)
@@ -1,75 +1,76 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>This tests that the main frame has access to a javascript: URL loaded in an iframe inside another javascript: URL loaded iframe.</p>
-    <iframe id="aFrame" style="width: 500px; height: 300px;"></iframe>
-    <pre id='console'></pre>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.dumpChildFramesAsText();
-            layoutTestController.waitUntilDone();
-        }
-
-        var innerURL = 'javascript:\\\"<html>'
-            + "<body>"
-            +     '<p id=\\\\\\"accessMe\\\\\\">FAIL: Cross frame access to a javascript: URL 2 levels deep was denied.</p>'
-            +     "<p>Inner-inner iframe.</p>"
-            + "</body>"
-            + '</html>\\\"';
-
-        var url = "javascript:\"<html>"
-            + "<body>"
-            +     "<iframe src='" + innerURL + "'></iframe>"
-            +     "<p>Inner iframe.</p>"
-            + "</body>"
-            + "</html>\"";
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.dumpChildFramesAsText();
+                layoutTestController.waitUntilDone();
+            }
 
-        var iframe = document.getElementById("aFrame");
-        iframe.src = url;
+            var innerURL = 'javascript:\\\"<html>'
+                + "<head>"
+                +     "<scr" + "ipt>"
+                +         "window.onload = function()"
+                +         "{"
+                +             "if (window.layoutTestController)"
+                +                 "layoutTestController.globalFlag = true;"
+                +         "}"
+                +     "</scr" + "ipt>"
+                + "</head>"
+                + "<body>"
+                +     '<p id=\\\\\\"accessMe\\\\\\">FAIL: Cross frame access to a javascript: URL 2 levels deep was denied.</p>'
+                +     "<p>Inner-inner iframe.</p>"
+                + "</body>"
+                + '</html>\\\"';
 
-        var testDone = false;
+            var url = "javascript:\"<html>"
+                + "<body>"
+                +     "<iframe src='" + innerURL + "'></iframe>"
+                +     "<p>Inner iframe.</p>"
+                + "</body>"
+                + "</html>\"";
 
-        setTimeout(test, 1);
+            var iframe = document.getElementById("aFrame");
+            iframe.src = url;
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
-            }
-        }, 2000);
-
-        function test() {
-            var innerFrame = window.frames[0];
-
-            if (!innerFrame) {
-                setTimeout(test, 1);
-                return;
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
+        }
 
-            var innerInnerFrame = innerFrame.frames[0];
-            if (!innerInnerFrame) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
 
+        runTest = function()
+        {
             try {
-                if (innerInnerFrame.document.getElementById('accessMe')) {
-                    innerInnerFrame.document.getElementById('accessMe').innerHTML = 'PASS: Cross frame access to a javascript: URL 2 levels deep was allowed!';
-                    log('PASS: Cross frame access to a javascript: URL 2 levels deep was allowed!');
-                    testDone = true;
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                    return;
-                }
+                window[0][0].document.getElementById('accessMe').innerHTML = 'PASS: Cross frame access to a javascript: URL 2 levels deep was allowed!';
+                log('PASS: Cross frame access to a javascript: URL 2 levels deep was allowed!');
             } catch (e) {
+                log('FAIL: Cross frame access to a javascript: URL 2 levels deep was denied.');
             }
-
-            setTimeout(test, 1);
         }
     </script>
+</head>
+<body>
+    <p>This tests that the main frame has access to a javascript: URL loaded in an iframe inside another javascript: URL loaded iframe.</p>
+    <iframe id="aFrame" style="width: 500px; height: 300px;"></iframe>
+    <pre id='console'></pre>
 </body>
 </html>
index 38700e724622e1988a0575084325321be6b1ef5e..b53b7b30d3e7d424a8665d738087af4d10b5cda7 100644 (file)
@@ -1,45 +1,55 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>Opener Frame</p>
-    <pre id="console"></pre>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.waitUntilDone();
-            layoutTestController.setCanOpenWindows();
-        }
+        var openedWindow;
 
-        var url = "javascript:\"<html><body><p>Opened Frame</p><p id='accessMe'></p></body></html>\"";
-        var openedWindow = window.open(url);
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.waitUntilDone();
+                layoutTestController.setCanOpenWindows();
+            }
 
-        var testDone = false;
+            var url = "javascript:\"<html><head><scr" + "ipt>window.onload = function() { if (window.layoutTestController) layoutTestController.globalFlag = true; }</scr" + "ipt></head><body><p>Opened Frame</p><p id='accessMe'>FAIL</p></body></html>\"";
+            openedWindow = window.open(url);
 
-        setTimeout(test, 1);
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
+            }
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Access to a window opened with a javascript: URL was denied.");
-                closeWindowAndNotifyDone(openedWindow);
+        }
+
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
+                return;
             }
-        }, 2000);
+            runTest();
+            closeWindowAndNotifyDone(openedWindow);
+        }
 
-        function test() {
+        runTest = function()
+        {
             try {
-                if (openedWindow.document.getElementById('accessMe')) {
-                    log("PASS: Access to a window opened with a javascript: URL was allowed!");
-                    testDone = true;
-                    closeWindowAndNotifyDone(openedWindow);
-                    return;
-                }
+                openedWindow.document.getElementById('accessMe').innerHTML = "PASS: Access to a window opened with a javascript: URL was allowed!";
+                log("PASS: Access to a window opened with a javascript: URL was allowed!");
             } catch (e) {
+                log("FAIL: Access to a window opened with a javascript: URL was denied.");
             }
-
-            setTimeout(test, 1);
-            return;
         }
     </script>
+</head>
+<body>
+    <p>Opener Frame</p>
+    <pre id="console"></pre>
 </body>
 </html>
index 6d960ce8c49362d923a04742879e81e782d662ab..2459157afd24c6b04c3e397dd514ef2cfcbfdbf1 100644 (file)
@@ -1,6 +1,5 @@
 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://127.0.0.1:8000/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-subframe.html from frame with URL about:blank. Domains, protocols and ports must match.
 
-CONSOLE MESSAGE: line 1: TypeError: Undefined value
 The scenario for this test is that you have an iframe with content from a foreign domain. In that foreign content is an iframe which loads a javascript: URL. This tests that the javascript: URL loaded iframe does not have access to the main frame using top.document.
 
 
index b306c47fff8a524215e6c8a717206522fe207a87..52c9d586bd886bbaacc582f9878aed5f1b79c6fa 100644 (file)
@@ -8,10 +8,9 @@
     <script>
         if (window.layoutTestController) {
             layoutTestController.dumpAsText();
+            layoutTestController.waitUntilDone();
             layoutTestController.dumpChildFramesAsText();
         }
-        
-        // FIXME: Add polling to make sure this works
     </script>
 </body>
 </html>
index b0f851b2cb03d86a0cdf375ed44add95727b7cdb..d719b010613351447452824abecbefc10656a2a2 100644 (file)
@@ -1,6 +1,5 @@
 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://127.0.0.1:8000/security/javascriptURL/xss-DENIED-from-javascript-url-in-foreign-domain-window-open.html from frame with URL about:blank. Domains, protocols and ports must match.
 
-CONSOLE MESSAGE: line 1: TypeError: Undefined value
 Opener Frame
 
 Pass: Cross frame access from a javascript: URL on a different domain was denied.
index cba8f2196d13c424af8cacd80a8d2aedfc911d9b..762d80f42226905d9fa50b0fead746cd691a75fc 100644 (file)
@@ -1,49 +1,37 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>Opener Frame</p>
-    <p id='accessMe'>Pass: Cross frame access from a javascript: URL on a different domain was denied.</p>
-    <pre id='console'></pre>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.waitUntilDone();
-            layoutTestController.setCanOpenWindows();
-        }
-
-        var openedWindow = window.open("http://localhost:8000/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-opened-frame.html");
-
-        // Poll until javacript URL: subframe on window.open'ed frames has loaded as indicated by 'flag' iframe
-        var testDone = false;
-
-        setTimeout(test, 1);
+        var openedWindow;
 
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                closeWindowAndNotifyDone(openedWindow);
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.setCanOpenWindows();
+                layoutTestController.waitUntilDone();
             }
-        }, 2000);
 
-        function test() {
-            var innerFrameInOpenedWindow = openedWindow.frames['aFrame'];
-            if (!innerFrameInOpenedWindow) {
-                setTimeout(test, 1);
-                return;
+            openedWindow = window.open("http://localhost:8000/security/javascriptURL/resources/foreign-domain-javascript-url-accessor-opened-frame.html");
+
+            if (window.layoutTestController) {
+                setTimeout(pollUntilDone, 1);
             }
+        }
 
-            // When the flag frame is not undefined, we know that the inner-inner frame has loaded.
-            var flagFrame = innerFrameInOpenedWindow.frames['flag'];
-            if (!flagFrame) {
-                setTimeout(test, 1);
+        pollUntilDone = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollUntilDone, 1);
                 return;
             }
-
-            testDone = true;
             closeWindowAndNotifyDone(openedWindow);
         }
     </script>
+</head>
+<body>
+    <p>Opener Frame</p>
+    <p id='accessMe'>Pass: Cross frame access from a javascript: URL on a different domain was denied.</p>
+    <pre id='console'></pre>
 </body>
 </html>
index aa6924dbd1c121c98aa05459f074ca4c87d3e3a5..63fe17f5c853d8748b8892aa099ce68d0ffc0d43 100644 (file)
@@ -19,10 +19,3 @@ Frame: 'aFrame'
 PASS: Cross frame access from a frame on a foreign domain denied!
 
 Inner-inner iframe. This iframe (which is javascript: URL and whose parent is on a foreign domain) is the frame that the main frame is trying to access. It should not have access to it.
-
-
-
---------
-Frame: 'flag'
---------
-
index 8d4c04089eb332c70e9da45f435e6e190e7591b9..57f5e487e76b4276efef9d02724595ddf06343e0 100644 (file)
@@ -1,66 +1,54 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <p>The scenario for this test is that you have an iframe with content from a foreign domain.  In that foreign content
-        is an iframe which loads a javascript: URL.  This tests that this main document does not have access to that 
-        javascript: URL loaded iframe.</p>
-    <iframe src="http://localhost:8000/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-iframe.html" style="width: 400px; height:200px;"></iframe>
-    <pre id="console"></pre>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.dumpChildFramesAsText();
-            layoutTestController.waitUntilDone();
-        }
-
-        var innerFrame = window.frames[0];
-
-        var testDone = false;
-
-        setTimeout(test, 1);
-
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.dumpChildFramesAsText();
+                layoutTestController.waitUntilDone();
             }
-        }, 2000);
 
-        function test() {
-            var innerInnerFrame = innerFrame.frames[0];
-
-            if (!innerInnerFrame) {
-                setTimeout(test, 1);
-                return;
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
+        }
 
-            // When the flag frame is not undefined, we know that the inner-inner frame has loaded.
-            var flagFrame = innerInnerFrame.frames['flag'];
-            if (!flagFrame) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            layoutTestController.notifyDone();
+        }
 
+        runTest = function()
+        {
             try {
-                if (innerInnerFrame.document.getElementById('accessMe')) {
-                    innerInnerFrame.document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a javascript: URL embed in a frame on a foreign domain allowed.";
-                    log("FAIL: Cross frame access to a javascript: URL embed in a frame on a foreign domain allowed.");
-                    testDone = true;
-                    if (window.layoutTestController)
-                        layoutTestController.notifyDone();
-                    return;
-                }
+                window[0][0].document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a javascript: URL embed in a frame on a foreign domain allowed.";
+                log("FAIL: Cross frame access to a javascript: URL embed in a frame on a foreign domain allowed.");
+                return;
             } catch (e) {
             }
 
             log("PASS: Cross frame access to a javascript: URL embed in a frame on a foreign domain denied!");
-            testDone = true;
-            if (window.layoutTestController)
-                layoutTestController.notifyDone();
         }
     </script>
+</head>
+<body>
+    <p>The scenario for this test is that you have an iframe with content from a foreign domain.  In that foreign content
+        is an iframe which loads a javascript: URL.  This tests that this main document does not have access to that 
+        javascript: URL loaded iframe.</p>
+    <iframe src="http://localhost:8000/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-iframe.html" style="width: 400px; height:200px;"></iframe>
+    <pre id="console"></pre>
 </body>
 </html>
index d739afa8772bf49c209e83004aaadcdba05ddbe6..eb1dddea325287393294706b11162b314ad79cb4 100644 (file)
@@ -1,59 +1,53 @@
 <html>
 <head>
     <script src="../resources/cross-frame-access.js"></script>
-</head>
-<body>
-    <pre id="console"></pre>
     <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-            layoutTestController.waitUntilDone();
-            layoutTestController.setCanOpenWindows();
-        }
-
-        var openedWindow = window.open("http://localhost:8000/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-opened-frame.html");
-
-        var testDone = false;
-
-        setTimeout(test, 1);
-
-        setTimeout(function() {
-            if (!testDone) {
-                log("FAIL: Test timed out");
-                closeWindowAndNotifyDone(openedWindow);
+        var openedWindow;
+
+        window.onload = function()
+        {
+            if (window.layoutTestController) {
+                layoutTestController.dumpAsText();
+                layoutTestController.setCanOpenWindows();
+                layoutTestController.waitUntilDone();
             }
-        }, 2000);
 
-        function test() {
-            var innerFrameInOpenedWindow = openedWindow.frames['aFrame'];
+            openedWindow = window.open("http://localhost:8000/security/javascriptURL/resources/foreign-domain-javascript-url-accessee-opened-frame.html");
 
-            if (!innerFrameInOpenedWindow) {
-                setTimeout(test, 1);
-                return;
+            if (window.layoutTestController) {
+                setTimeout(pollForTest, 1);
+            } else {
+                log("To run the test, click the button below when the opened window finishes loading.");
+                var button = document.createElement("button");
+                button.appendChild(document.createTextNode("Run Test"));
+                button.onclick = runTest;
+                document.body.appendChild(button);
             }
+        }
 
-            // When the flag frame is not undefined, we know that the inner-inner frame has loaded.
-            var flagFrame = innerFrameInOpenedWindow.frames['flag'];
-            if (!flagFrame) {
-                setTimeout(test, 1);
+        pollForTest = function()
+        {
+            if (!layoutTestController.globalFlag) {
+                setTimeout(pollForTest, 1);
                 return;
             }
+            runTest();
+            closeWindowAndNotifyDone(openedWindow);
+        }
 
+        runTest = function()
+        {
             try {
-                if (innerFrameInOpenedWindow.document.getElementById('accessMe')) {
-                    innerFrameInOpenedWindow.document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a javascript: URL embed in a frame window.open'ed on foreign domain allowed.";
-                    log("FAIL: Cross frame access to a javascript: URL embed in a frame window.open'ed on foreign domain allowed.");
-                    testDone = true;
-                    closeWindowAndNotifyDone(openedWindow);
-                    return;
-                }
+                openedWindow[0].document.getElementById('accessMe').innerHTML = "FAIL: Cross frame access to a javascript: URL embed in a frame window.open'ed on foreign domain allowed.";
+                log("FAIL: Cross frame access to a javascript: URL embed in a frame window.open'ed on foreign domain allowed.");
+                return;
             } catch (e) {
             }
-
             log("PASS: Cross frame access to a javascript: URL embed in a frame window.open'ed on foreign domain denied!");
-            testDone = true;
-            closeWindowAndNotifyDone(openedWindow);
         }
     </script>
+</head>
+<body>
+    <pre id="console"></pre>
 </body>
 </html>
index e71ab4b28de385dbfee68c763c0154c58df62c6d..3dc5ec1d7ae4c56a62e25d5979b279d83372a6ff 100644 (file)
@@ -8,10 +8,3 @@ Frame: 'aFrame'
 PASS: Protocol name compare is case insensitive!
 
 Inner iframe.
-
-
-
---------
-Frame: 'flag'
---------
-
index 09f99f6367a1e26a276a5aa3bf260817f31e6920..ceb4ef57ef0f3d7c66eec12ff2be52424086b56a 100644 (file)
@@ -11,6 +11,5 @@
 <body onload="fireSentinel();">
     <p id='accessMe'></p>
     <p>Inner iframe.</p>
-    <iframe name='flag'></iframe>
 </body>
 </html>