| <b>This test passes if it does not alert the fail.html's content when clicking the button.</b><br> |
| <input id="testButton" type="button" value="Click me"></input> |
| testRunner.setCanOpenWindows(); |
| testRunner.waitUntilDone(); |
| event.target.src = "javascript:alert(document.documentElement.outerHTML)"; |
| } else if (counter == 3) { |
| a = frame.contentDocument.createElement("a"); |
| a.href = cache_frame.src; |
| showModalDialog(URL.createObjectURL(new Blob([` |
| let intervalID = setInterval(() => { |
| opener.frame.contentWindow.foo; |
| clearInterval(intervalID); |
| </scr` + "ipt>"], {type: "text/html"}))); |
| testButton.onclick = _ => { |
| frame = document.body.appendChild(document.createElement("iframe")); |
| frame.contentWindow.location = `javascript:'<b><p><iframe` |
| + ` onload="top.run(event)"></iframe></b></p>'`; |
| cache_frame = document.body.appendChild(document.createElement("iframe")); |
| cache_frame.src = "http://localhost:8000/security/resources/fail.html"; |
| cache_frame.style.display = "none"; |
| internals.withUserGesture(() => { |