| <p>Test that destroying a frame doesn't cause a crash when posting a message to a MessagePort it owned.</p> |
| return GCController.collect(); |
| for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect) |
| var s = new String("abc"); |
| document.getElementById("log").innerHTML += message + "<br>"; |
| testRunner.waitUntilDone(); |
| frameDoc = window.frames[0].document; |
| var channel = new MessageChannel; |
| window.frames[0].postMessage("msg", "*", [channel.port2]); |
| mainPort = channel.port1; |
| mainPort.postMessage("ping"); |
| mainPort.onmessage = test2; |
| var frameElement = document.getElementsByTagName("iframe")[0]; |
| frameElement.parentNode.removeChild(frameElement); |
| mainPort.postMessage("ping"); |
| mainPort.onmessage = function(evt) { |
| log("Unexpected response: FAIL"); |
| log("Didn't crash: SUCCESS"); |
| <iframe src="resources/message-port-iframe.html" onload="test()"></iframe> |