2 <p>Test worker garbage collection. Should print
"SUCCESS".
</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 interval
= setInterval(gc
, 0);
27 var worker
= new Worker('resources/worker-common.js');
28 worker
.postMessage("ping");
29 worker
.onmessage = function(evt
) {
30 this.postMessage("ping");
31 this.onmessage = function() {
33 clearInterval(interval
);
34 if (window
.testRunner
)
35 testRunner
.notifyDone();