Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/xpath/xpath-other-nodeset-result-should-mark-its-nodeset.html

Issue 2847943002: Cleanup LayoutTests that define a function gc(). (Closed)
Patch Set: Fixing Layout Tests Failures Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698