OLD | NEW |
1 <body onload="test()"> | 1 <body onload="test()"> |
2 <p>Running test...</p> | 2 <p>Running test...</p> |
3 <textarea id=t rows=20>textarea</textarea> | 3 <textarea id=t rows=20>textarea</textarea> |
4 <script> | 4 <script> |
5 if (window.testRunner) { | 5 if (window.testRunner) { |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
8 } | 8 } |
9 | 9 |
10 function gc() | 10 function gc() |
11 { | 11 { |
12 if (window.GCController) | 12 if (window.GCController) |
13 return GCController.collect(); | 13 return GCController.collect(); |
14 | 14 |
15 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) | 15 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) |
16 var s = new String("abc"); | 16 var s = new String("abc"); |
17 } | 17 } |
18 } | 18 } |
19 | 19 |
20 function test() | 20 function test() |
21 { | 21 { |
22 var elem = document.getElementById("t"); | 22 var elem = document.getElementById("t"); |
23 var nodes = document.getElementById("t").getAttributeNode('rows').childNodes
; | 23 var nodes = document.getElementById("t").getAttributeNode('rows').childNodes
; |
24 nodes[0]; // Prime the child node cache. | 24 nodes[0]; // Prime the child node cache. |
25 document.body.removeChild(document.getElementById("t")); | 25 document.body.removeChild(document.getElementById("t")); |
26 elem.getAttributeNode('rows').removeChild(nodes[0]); | 26 elem.getAttributeNode('rows').removeChild(nodes[0]); |
27 setTimeout(function() { | 27 setTimeout(function() { |
28 gc(); | 28 gc(); |
29 gc(); | |
30 gc(); | |
31 try { nodes[0].textContent } catch (ex) { } | 29 try { nodes[0].textContent } catch (ex) { } |
32 | 30 |
33 document.getElementsByTagName("p")[0].innerHTML = "PASS" | 31 document.getElementsByTagName("p")[0].innerHTML = "PASS" |
34 if (window.testRunner) | 32 if (window.testRunner) |
35 testRunner.notifyDone(); | 33 testRunner.notifyDone(); |
36 }, 0); | 34 }, 0); |
37 } | 35 } |
38 </script> | 36 </script> |
OLD | NEW |