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.layoutTestController) {
21 layoutTestController.dumpAsText();
22 layoutTestController.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.layoutTestController)
35 layoutTestController.notifyDone();