blob: ef8277f7e21955b84db2807faa068e78f156f370 [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setDumpConsoleMessages(false);
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
}
function log(msg) {
var div = document.createElement("div");
div.appendChild(document.createTextNode(msg));
document.getElementById("console").appendChild(div);
}
var readyCount = 0;
window.addEventListener("message", function(e) {
if (e.data == "ready") {
++readyCount;
if (readyCount == 2) {
helper.postMessage("set", "*");
}
} else if (e.data == "pass") {
target.document.body.innerHTML = "Should have navigated this window. It should be still be same-origin.";
log("PASS");
log("There are currently " + testRunner.windowCount() + " windows opened.");
target.close();
helper.postMessage("cleanup", "*");
} else if (e.data == "done") {
helper.close();
if (window.testRunner)
testRunner.notifyDone();
}
}, false);
window.onload = function() {
target = window.open("resources/ready.html", "targetWindow");
helper = window.open("http://localhost:8000/security/frameNavigation/resources/not-opener-helper.html");
}
</script>
</head>
<body>
<div id="console"></div>
</body>
</html>