Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / sandbox-inherit-to-initial-document.html
blob7bf4f086846e53a24932748ae464d5c543bac9f3
1 <body onload="test()">
2 <p>Test how sandbox flags get inherited to initial document in subframe.</p>
3 <div id="result">Running...</div>
4 <iframe src="resources/iframe-no-src.html" sandbox="allow-scripts allow-same-origin"></iframe>
5 <script>
6 if (window.testRunner) {
7 testRunner.waitUntilDone();
8 testRunner.dumpAsText();
11 var timeoutId;
13 function scriptWorked()
15 document.getElementById("result").innerHTML = "PASS";
16 if (window.testRunner)
17 testRunner.notifyDone();
18 clearTimeout(timeoutId);
21 function timedOut()
23 document.getElementById("result").innerHTML = "FAIL";
24 if (window.testRunner)
25 testRunner.notifyDone();
28 function test()
30 var doc = frames[0].frames[0].document;
31 var scr = doc.createElement("script");
32 scr.appendChild(doc.createTextNode("top.scriptWorked()"));
34 timeoutId = setTimeout(timedOut, 10);
36 doc.body.appendChild(scr);
38 </script>
39 </body>