blob: 9d5c721393189eca4d836b3b3079fcb29ad83539 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta name="referrer" content="origin">
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
}
function receiveMessage(messageEvent) {
if (messageEvent.data === "done") {
if (window.testRunner)
testRunner.notifyDone();
} else if (messageEvent.data === "ready")
target.postMessage("new-subframe", "*");
else
document.getElementById("log").innerHTML += messageEvent.data + "<br>";
}
window.addEventListener("message", receiveMessage, false);
</script>
</head>
<body>
<p>This test opens a new window that embeds a subframe. 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>