2 <div id=
"console"></div>
4 if (window
.testRunner
) {
5 testRunner
.dumpAsText();
6 testRunner
.waitUntilDone();
9 var iframe
= document
.body
.appendChild(document
.createElement("iframe"));
13 var win
= iframe
.contentWindow
;
15 try { recurse(); } catch(e
) {}
16 try { win
.location
; } catch(e
) {
21 if (o
.constructor.constructor("return location.hostname")() == "127.0.0.1") {
22 document
.getElementById("console").innerText
= "PASS: non-cross-site exception thrown.";
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
);
38 var interval
= setInterval(waitForLoaded
, 1);
39 iframe
.src
= "http://localhost:8000/resources/dummy.html";