| <p>Test that messaging an inactive frameless document works as expected.</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(); |
| otherDocument = 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.src = "resources/window-opened.html"; |
| frameElement.onload = test3; |
| mainPort.postMessage("alert FAIL: the document is inactive."); |
| mainPort.postMessage("freeze"); |
| mainPort.postMessage("ping"); |
| mainPort.onmessage = function(evt) { |
| log("Unexpected response: FAIL"); |
| log("Didn't crash, freeze or respond: SUCCESS"); |
| <iframe src="resources/message-port-iframe.html" onload="test()" width=0 height=0 frameborder=0></iframe> |