blob: 7c6046661fe036b00c63daabfd2c59d496b39b0d [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function recv(e) {
var msg = 'Received message: data="' + e.data + '" origin="' + e.origin + '"';
document.getElementById("result").firstChild.data = msg;
if (window.testRunner)
testRunner.notifyDone();
}
addEventListener("message", recv, false);
</script>
<base href="http://www.example.com/">
<body>
<div>window.location.href = <script>document.write(document.location.href);</script></div>
<div><iframe src="data:text/html,<script>top.postMessage('Hello from child', '*');document.write('Message sent');</script>"
id="child" width="800" height="300" style="border: 1px solid black;">
</iframe></div>
<div id="result">waiting...</div>
</body>
</html>