Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Window / post-message-detach-in-handler.html
blob0faa5fd3ceb11fd79649675db075f9d9465422c7
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <script>
7 description("Test that detaching document in window.postMessage() handler does not crash.");
9 window.jsTestIsAsync = true;
11 if (window.testRunner) {
12 testRunner.dumpAsText();
13 testRunner.waitUntilDone();
16 function postMessageToSelf() {
17 setInterval(function() { iframe.contentWindow.postMessage("msg", "*"); }, 0);
20 function receiveMessage(event) {
21 testPassed("Received message " + event.data);
22 document.body.removeChild(iframe);
23 finishJSTest();
26 var iframe = document.createElement("iframe");
27 document.body.appendChild(iframe);
28 iframe.contentWindow.addEventListener("message", receiveMessage, false);
29 postMessageToSelf();
30 </script>
31 </body>
32 </html>