<html>
<head>
<meta name="referrer" content="origin" />
<script>
window.addEventListener("message", receiveMessage, false);

function receiveMessage(evt) {
    if (evt.data == "done") {
        if (window.testRunner)
            testRunner.notifyDone();
    } else if (typeof(evt.data) == "object" && evt.data.action == "click")  {
        var link = document.getElementById("link");
        eventSender.mouseMoveTo(link.offsetLeft + evt.data.offsetLeft + 2,
                                link.offsetTop + evt.data.offsetTop + 2);
        eventSender.mouseDown();
        eventSender.mouseUp();
    } else {
        document.getElementById("log").innerHTML += evt.data + "<br>";
    }
}
</script>
</head>
<body>
<a id="link" target="_blank" href="https://127.0.0.1:8443/resources/redirect.py?url=https://127.0.0.1:8443/security/resources/referrer-policy-postmessage.py" rel="opener">If not running in DumpRenderTree, click this link</a>
<div id="log"></div>
</body>
</html>
