OLD | NEW |
1 <body> | 1 <body> |
2 <p>Test that delivering a message to a port that was never referenced from JS do
esn't cause a crash.</p> | 2 <p>Test that delivering a message to a port that was never referenced from JS do
esn't cause a crash.</p> |
3 <pre id=log></pre> | 3 <pre id=log></pre> |
4 | 4 <script src="../../resources/gc.js"></script> |
5 <script> | 5 <script> |
6 function gc() | |
7 { | |
8 if (window.GCController) | |
9 return GCController.collect(); | |
10 | |
11 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) | |
12 var s = new String("abc"); | |
13 } | |
14 } | |
15 | 6 |
16 function log(message) | 7 function log(message) |
17 { | 8 { |
18 document.getElementById("log").innerHTML += message + "<br>"; | 9 document.getElementById("log").innerHTML += message + "<br>"; |
19 } | 10 } |
20 | 11 |
21 if (window.testRunner) { | 12 if (window.testRunner) { |
22 testRunner.dumpAsText(); | 13 testRunner.dumpAsText(); |
23 testRunner.waitUntilDone(); | 14 testRunner.waitUntilDone(); |
24 } | 15 } |
25 | 16 |
26 var channel = new MessageChannel; | 17 var channel = new MessageChannel; |
27 channel.port1.postMessage("msg"); | 18 channel.port1.postMessage("msg"); |
28 channel.port1.start(); | 19 channel.port1.start(); |
29 channel = 0; | 20 channel = 0; |
30 gc(); | 21 gc(); |
31 | 22 |
32 setTimeout("log('PASS'); if (window.testRunner) testRunner.notifyDone()", 100); | 23 setTimeout("log('PASS'); if (window.testRunner) testRunner.notifyDone()", 100); |
33 | 24 |
34 </script> | 25 </script> |
35 </body> | 26 </body> |
OLD | NEW |