2 <p>Test some cases of MessagePort garbage collection.</p>
7 if (window.GCController)
8 return GCController.collect();
10 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
11 var s = new String("abc");
17 document.getElementById("log").innerHTML += message + "<br>";
22 channel.port1.close();
23 channel.port2.close();
28 if (window.testRunner)
29 testRunner.notifyDone();
32 if (window.testRunner) {
33 testRunner.dumpAsText();
34 testRunner.waitUntilDone();
37 var channel = new MessageChannel;
38 channel.port1.foo = "bar";
41 log("Should be 'bar': " + channel.port1.foo);
43 channel.port1.onmessage = function() { log("onmessage"); }
44 channel.port1.addEventListener("message", function() { log("message listener"); done(); }, false);
47 channel.port1.start();
48 channel.port2.postMessage("msg");