OLD | NEW |
1 <body> | 1 <body> |
2 <p>Test that MessagePort close event gets delivered (without crashing) even if t
he channel object is garbage collected.</p> | 2 <p>Test that MessagePort close event gets delivered (without crashing) even if t
he channel object is garbage collected.</p> |
3 <pre id=log></pre> | 3 <pre id=log></pre> |
| 4 <script src="../../resources/gc.js"></script> |
4 <script> | 5 <script> |
5 function gc() | |
6 { | |
7 if (window.GCController) | |
8 return GCController.collect(); | |
9 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) | |
10 var s = new String("abc"); | |
11 } | |
12 } | |
13 | 6 |
14 function log(message) | 7 function log(message) |
15 { | 8 { |
16 document.getElementById("log").innerHTML += message + "<br>"; | 9 document.getElementById("log").innerHTML += message + "<br>"; |
17 } | 10 } |
18 | 11 |
19 if (window.testRunner) { | 12 if (window.testRunner) { |
20 testRunner.dumpAsText(); | 13 testRunner.dumpAsText(); |
21 testRunner.waitUntilDone(); | 14 testRunner.waitUntilDone(); |
22 } | 15 } |
(...skipping 13 matching lines...) Expand all Loading... |
36 log("DONE"); | 29 log("DONE"); |
37 gc(); | 30 gc(); |
38 if (window.testRunner) | 31 if (window.testRunner) |
39 testRunner.notifyDone(); | 32 testRunner.notifyDone(); |
40 }, 0); | 33 }, 0); |
41 channel = new MessageChannel; | 34 channel = new MessageChannel; |
42 gc(); | 35 gc(); |
43 | 36 |
44 </script> | 37 </script> |
45 </body> | 38 </body> |
OLD | NEW |