2 <p>Test that MessagePort messages are delivered even if both ports are inaccessible from JS any more.
</p>
3 <p>Should say PASS twice.
</p>
8 if (window
.GCController
)
9 return GCController
.collect();
11 for (var i
= 0; i
< 10000; i
++) { // > force garbage collection (FF requires about 9K allocations before a collect)
12 var s
= new String("abc");
18 document
.getElementById("log").innerHTML
+= message
+ "<br>";
21 if (window
.testRunner
) {
22 testRunner
.dumpAsText();
23 testRunner
.waitUntilDone();
28 var channel
= new MessageChannel
;
30 channel
.port1
.onmessage = function(evt
) { log("PASS: message delivered. Port: " + evt
.target
); test2(); }
31 channel
.port2
.postMessage("msg");
39 var channel
= new MessageChannel
;
41 channel
.port2
.close();
45 log("PASS: port closed.");
46 if (window
.testRunner
)
47 testRunner
.notifyDone();