2 <p>Test shared worker garbage collection. Should print
"PASS" followed by
"DONE".
</p>
7 document
.getElementById("result").innerHTML
+= message
+ "<br>";
12 if (window
.GCController
)
13 return GCController
.collect();
15 for (var i
= 0; i
< 10000; i
++) { // force garbage collection (FF requires about 9K allocations before a collect)
16 var s
= new String("abc");
20 if (window
.testRunner
) {
21 testRunner
.dumpAsText();
22 testRunner
.waitUntilDone();
25 var worker
= new SharedWorker('resources/shared-worker-common.js', 'name');
26 worker
.port
.onmessage
= handleMessage
;
27 worker
.port
.postMessage("ping");
31 function handleMessage(event
) {
34 if (window
.testRunner
)
35 testRunner
.notifyDone();