blob: 2b25bdd042a8514363a91f9e74429fb48cadb66c [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta name="referrer" content="origin">
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function receiveMessage(messageEvent) {
if (messageEvent.data === "done") {
if (window.testRunner)
testRunner.notifyDone();
} else if (messageEvent.data === "ready")
target.postMessage("new-window", "*");
else
document.getElementById("log").innerHTML += messageEvent.data + "<br>";
}
window.addEventListener("message", receiveMessage, false);
</script>
</head>
<body>
<p>This test opens a new window that opens a new window. It passes, if the referrer is the origin only.</p>
<div id="log"></div>
<script>
var target = window.open("resources/nested-referrer-policy-postmessage.html");
</script>
</body>
</html>