Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / security / dataURL / xss-DENIED-to-data-url-sub-frame-2-level.html
index f88bd78..9c19ebd 100644 (file)
@@ -13,8 +13,7 @@
                 + "<head>"
                 +     "<scr" + "ipt>"
                 +         "function fireSentinel() {"
-                +             "if (window.testRunner)"
-                +                 "testRunner.globalFlag = true;"
+                +             "window.top.postMessage(\"perform test\", \"*\");"
                 +         "}"
                 +     "</scr" + "ipt>"
                 + "</head>"
                 + "</body>"
                 + "</html>";
 
+            window.addEventListener('message', performTest);
             var iframe = document.getElementById("aFrame");
             iframe.src = url;
-
-            if (window.testRunner) {
-                setTimeout(waitForFlag, 1);
-                function waitForFlag() {
-                    if (!testRunner.globalFlag) {
-                        setTimeout(waitForFlag, 1);
-                        return;
-                    }
-                    performTest();
-                }
-            } else {
-                log("Click the button when all the subframes have finished loading.");
-            }
         }
 
         function performTest() {
@@ -70,7 +57,6 @@
 </head>
 <body onload="loaded();">
     <p>This tests that the main frame doesn't have access to a data: URL loaded in an iframe inside another data: URL loaded iframe.</p>
-    <button onclick="performTest()">Test</button>
     <iframe id="aFrame" name="aFrame" style="width: 500px; height: 300px;"></iframe>
     <pre id='console'></pre>
 </body>