OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script> | 3 <script> |
4 if (window.testRunner) { | 4 if (window.testRunner) { |
5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
6 testRunner.waitUntilDone(); | 6 testRunner.waitUntilDone(); |
7 } | 7 } |
8 | 8 |
9 function gc() | 9 function gc() |
10 { | 10 { |
11 if (window.GCController) | 11 if (window.GCController) |
12 return GCController.collect(); | 12 return GCController.collect(); |
13 | 13 |
14 for (var i = 0; i < 10000; i++) { // force garbage collection (F
F requires about 9K allocations before a collect). | 14 for (var i = 0; i < 10000; i++) { // force garbage collection (F
F requires about 9K allocations before a collect). |
15 var s = new String("abc"); | 15 var s = new String("abc"); |
16 } | 16 } |
17 } | 17 } |
18 | 18 |
19 function runTest() | 19 function runTest() |
20 { | 20 { |
21 iteratorRoot = document.createElement(); | 21 iteratorRoot = document.createElement(); |
22 element = iteratorRoot.appendChild(document.createElement()); | 22 element = iteratorRoot.appendChild(document.createElement()); |
23 element.appendChild(document.createElement()); | 23 element.appendChild(document.createElement()); |
24 | 24 |
25 iterator = document.createNodeIterator(iteratorRoot, -1); | 25 iterator = document.createNodeIterator(iteratorRoot, -1); |
26 iterator.nextNode(); iterator.nextNode(); iterator.nextNode(); | 26 iterator.nextNode(); iterator.nextNode(); iterator.nextNode(); |
27 iterator.previousNode(); | 27 iterator.previousNode(); |
28 | 28 |
29 iteratorRoot.removeChild(element); | 29 iteratorRoot.removeChild(element); |
30 | 30 |
31 otherDocument = document.implementation.createHTMLDocument(); | 31 otherDocument = document.implementation.createHTMLDocument(); |
32 otherDocument.body.appendChild(iteratorRoot); | 32 otherDocument.body.appendChild(iteratorRoot); |
33 | 33 |
34 delete iterator; | 34 delete iterator; |
35 gc(); | 35 gc(); |
36 div = document.body.appendChild(document.createElement('div')); | 36 div = document.body.appendChild(document.createElement('div')); |
37 document.body.removeChild(div); | 37 document.body.removeChild(div); |
38 gc(); | 38 gc(); |
39 | 39 |
40 if (window.testRunner) | 40 if (window.testRunner) |
41 testRunner.notifyDone(); | 41 testRunner.notifyDone(); |
42 } | 42 } |
43 </script> | 43 </script> |
44 </head> | 44 </head> |
45 <body onload="runTest()"> | 45 <body onload="runTest()"> |
46 Test passes if it does not crash. | 46 Test passes if it does not crash. |
47 </body> | 47 </body> |
48 </html> | 48 </html> |
49 | |
OLD | NEW |