OLD | NEW |
1 <body> | 1 <body> |
2 <p>Test that workers stay reachable via message ports. | 2 <p>Test that workers stay reachable via message ports. |
3 Should print "DONE" when done.</p> | 3 Should print "DONE" when done.</p> |
4 <div id=result></div> | 4 <div id=result></div> |
5 <script> | 5 <script> |
6 function log(message) | 6 function log(message) |
7 { | 7 { |
8 document.getElementById("result").innerHTML += message + "<br>"; | 8 document.getElementById("result").innerHTML += message + "<br>"; |
9 } | 9 } |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 channel.port2.onmessage = function(evt) { | 31 channel.port2.onmessage = function(evt) { |
32 log("PASS: Worker is reachable."); | 32 log("PASS: Worker is reachable."); |
33 done(); | 33 done(); |
34 } | 34 } |
35 channel.port2.postMessage("ping"); | 35 channel.port2.postMessage("ping"); |
36 } | 36 } |
37 | 37 |
38 function gc() | 38 function gc() |
39 { | 39 { |
40 if (window.GCController) | 40 if (window.GCController) |
41 return GCController.collect(); | 41 return GCController.collectAll(); |
42 | 42 |
43 for (var i = 0; i < 10000; i++) { // force garbage collection (FF requires a
bout 9K allocations before a collect) | 43 for (var i = 0; i < 10000; i++) { // force garbage collection (FF requires a
bout 9K allocations before a collect) |
44 var s = new String("abc"); | 44 var s = new String("abc"); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 function done() | 48 function done() |
49 { | 49 { |
50 log("DONE"); | 50 log("DONE"); |
51 if (window.testRunner) | 51 if (window.testRunner) |
52 testRunner.notifyDone(); | 52 testRunner.notifyDone(); |
53 } | 53 } |
54 | 54 |
55 </script> | 55 </script> |
56 </body> | 56 </body> |
57 </html> | 57 </html> |
58 | 58 |
OLD | NEW |