Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / security / xss-DENIED-cross-origin-stack-overflow.html
blob35e6d11da5b11b0e69dbe8730742a2b1ca9be39b
1 <!DOCTYPE html>
2 <div id="console"></div>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
9 var iframe = document.body.appendChild(document.createElement("iframe"));
10 var o = undefined;
12 function test() {
13 var win = iframe.contentWindow;
14 function recurse() {
15 try { recurse(); } catch(e) {}
16 try { win.location; } catch(e) {
17 o = e;
20 recurse();
21 if (o.constructor.constructor("return location.hostname")() == "127.0.0.1") {
22 document.getElementById("console").innerText = "PASS: non-cross-site exception thrown.";
23 } else {
24 document.getElementById("console").innerText = "FAIL: cross-site exception thrown.";
26 if (window.testRunner) {
27 testRunner.notifyDone();
31 function waitForLoaded() {
32 try { frames[0].a; } catch(e) {
33 clearInterval(interval);
34 test();
38 var interval = setInterval(waitForLoaded, 1);
39 iframe.src = "http://localhost:8000/resources/dummy.html";
40 </script>