blob: bdb80cd21c7e5489d66078c3faf97b998f5089c3 [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
testRunner.setCloseRemainingWindowsWhenComplete(true);
}
window.onload = function()
{
victim = document.body.appendChild(document.createElement("iframe"));
wnd = victim.contentWindow.open();
victim.src = "http://localhost:8080/security/resources/innocent-victim.html";
victim.onload = function() {
victim.onload = null;
wnd.eval("(" + function() {
location = "javascript:(" + function() {
a = document.createElement("a");
a.href = "about:blank";
a.click();
return "<script>(" + function() {
opener.location = "javascript:alert(location)";
if (window.testRunner)
setTimeout("testRunner.notifyDone()", 0);
} + ")()<\/script>";
} + ")()";
} + ")()");
}
}
</script>
</head>
<body>
<p>This test passes if there's no alert dialog.
</body>
</html>