3 <script src=
"../../../resources/js-test.js"></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
);
26 var iframe
= document
.createElement("iframe");
27 document
.body
.appendChild(iframe
);
28 iframe
.contentWindow
.addEventListener("message", receiveMessage
, false);