OLD | NEW |
1 <html> | 1 <html> |
2 <body onload="runTest()"> | 2 <body onload="runTest()"> |
| 3 <script src="../../resources/gc.js"></script> |
3 <script> | 4 <script> |
4 var count = 0; | 5 var count = 0; |
5 if (window.testRunner) | 6 if (window.testRunner) |
6 { | 7 { |
7 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
8 testRunner.waitUntilDone(); | 9 testRunner.waitUntilDone(); |
9 } | 10 } |
10 | 11 |
11 function runTest() | 12 function runTest() |
12 { | 13 { |
(...skipping 13 matching lines...) Expand all Loading... |
26 { | 27 { |
27 try { | 28 try { |
28 var range = document.createRange(); | 29 var range = document.createRange(); |
29 range.setStart(divBlock, 0); | 30 range.setStart(divBlock, 0); |
30 range.setEnd(divBlock, divBlock.childNodes.length - 1); | 31 range.setEnd(divBlock, divBlock.childNodes.length - 1); |
31 range.deleteContents(); | 32 range.deleteContents(); |
32 gc(); | 33 gc(); |
33 } catch(e) { } | 34 } catch(e) { } |
34 } | 35 } |
35 | 36 |
36 function gc() | |
37 { | |
38 if (window.GCController) | |
39 return GCController.collect(); | |
40 | |
41 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) | |
42 var s = new String(""); | |
43 } | |
44 } | |
45 </script> | 37 </script> |
46 <div id="divBlock"> | 38 <div id="divBlock"> |
47 <br/>textnode1<p id="pBlock"></p>textnode2<br/> | 39 <br/>textnode1<p id="pBlock"></p>textnode2<br/> |
48 </div> | 40 </div> |
49 </body> | 41 </body> |
50 </html> | 42 </html> |
OLD | NEW |