4 <script src=
"resources/recv.js"></script>
6 if (window
.testRunner
) {
7 testRunner
.dumpAsText();
8 testRunner
.waitUntilDone();
11 addEventListener('message', recv
, false);
14 var iframe
= document
.getElementById('child');
15 var win
= iframe
.contentWindow
;
17 log('Before calling postMessage');
18 win
.postMessage('Message from parent', '*');
19 log('After calling postMessage');
21 win
.postMessage('done', '*');
24 <base href=
"http://www.example.com/">
25 <body onload=
"test()">
26 <div>window.location.href =
<script>document
.write(document
.location
.href
);</script></div>
27 <div><iframe src=
"http://localhost:8000/security/postMessage/resources/post-message-listener.html"
28 id=
"child" width=
"800" height=
"300" style=
"border: 1px solid black;">
30 <div id=
"result">waiting...
</div>