OLD | NEW |
1 <html><head> | 1 <html><head> |
| 2 <script src="../../resources/gc.js"></script> |
2 <script> | 3 <script> |
3 if (window.testRunner) | 4 if (window.testRunner) |
4 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
5 | 6 |
6 // ANY_ORDERED_NODE_TYPE should be the last item in the array so that | 7 // ANY_ORDERED_NODE_TYPE should be the last item in the array so that |
7 // there is only one node that can match (thus it does not tie us to any | 8 // there is only one node that can match (thus it does not tie us to any |
8 // specific ordering in the nodeset). | 9 // specific ordering in the nodeset). |
9 var types = [ XPathResult.FIRST_ORDERED_NODE_TYPE, XPathResult.ANY_UNORD
ERED_NODE_TYPE ]; | 10 var types = [ XPathResult.FIRST_ORDERED_NODE_TYPE, XPathResult.ANY_UNORD
ERED_NODE_TYPE ]; |
10 | 11 |
11 function gc() | |
12 { | |
13 if (window.GCController) | |
14 return GCController.collect(); | |
15 | |
16 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF
requires about 9K allocations before a collect) | |
17 var s = new String("abc"); | |
18 } | |
19 } | |
20 | |
21 function test(type) | 12 function test(type) |
22 { | 13 { |
23 var result; | 14 var result; |
24 function initialize() { | 15 function initialize() { |
25 document.getElementsByTagName("span")[0].foo = "PASS"; | 16 document.getElementsByTagName("span")[0].foo = "PASS"; |
26 result = document.evaluate("//span", document.documentElement, n
ull, type, null); | 17 result = document.evaluate("//span", document.documentElement, n
ull, type, null); |
27 document.body.removeChild(document.getElementsByTagName("span")[
0]); | 18 document.body.removeChild(document.getElementsByTagName("span")[
0]); |
28 } | 19 } |
29 | 20 |
30 // Do initialization work in an inner function to avoid references | 21 // Do initialization work in an inner function to avoid references |
(...skipping 14 matching lines...) Expand all Loading... |
45 } | 36 } |
46 </script> | 37 </script> |
47 </head> | 38 </head> |
48 <body onload="tests()"> | 39 <body onload="tests()"> |
49 <span></span> | 40 <span></span> |
50 <span></span> | 41 <span></span> |
51 <div> Test for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=34231">34231
</a>: Nodes in XPath result snapshots should keep JS wrappers alive.</div> | 42 <div> Test for bug <a href="https://bugs.webkit.org/show_bug.cgi?id=34231">34231
</a>: Nodes in XPath result snapshots should keep JS wrappers alive.</div> |
52 <div> For this test to PASS you should see 2 PASS below.</div><br> | 43 <div> For this test to PASS you should see 2 PASS below.</div><br> |
53 <div id="console"></div> | 44 <div id="console"></div> |
54 </body></html> | 45 </body></html> |
OLD | NEW |