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

Side by Side Diff: LayoutTests/fast/dom/Attr/child-nodes-cache.html

Issue 211933008: Remove multiple GC calls and replace GCController.collect calls with GCController.collectAll (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert change to worker-event-listener Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/html-options-collection-lifetime.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/html-options-collection-lifetime.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698