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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/node-iterator-document-moved-crash.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> 1 <html>
2 <head> 2 <head>
3 <script src="../../resources/gc.js"></script>
3 <script> 4 <script>
4 if (window.testRunner) { 5 if (window.testRunner) {
5 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
6 testRunner.waitUntilDone(); 7 testRunner.waitUntilDone();
7 } 8 }
8 9
9 function gc()
10 {
11 if (window.GCController)
12 return GCController.collect();
13
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");
16 }
17 }
18
19 function runTest() 10 function runTest()
20 { 11 {
21 aElement = document.createElement('a'); 12 aElement = document.createElement('a');
22 divElement = document.createElement('div'); 13 divElement = document.createElement('div');
23 document.body.appendChild(divElement); 14 document.body.appendChild(divElement);
24 nodeIterator = win.document.createNodeIterator(aElement); 15 nodeIterator = win.document.createNodeIterator(aElement);
25 win.document.body.appendChild(aElement); 16 win.document.body.appendChild(aElement);
26 17
27 delete nodeIterator; 18 delete nodeIterator;
28 gc(); 19 gc();
29 document.body.removeChild(divElement); 20 document.body.removeChild(divElement);
30 gc(); 21 gc();
31 22
32 if (window.testRunner) 23 if (window.testRunner)
33 testRunner.notifyDone(); 24 testRunner.notifyDone();
34 } 25 }
35 </script> 26 </script>
36 </head> 27 </head>
37 <body> 28 <body>
38 <iframe onload="this.onload = null; win = this.contentWindow; runTest(); "></iframe> 29 <iframe onload="this.onload = null; win = this.contentWindow; runTest(); "></iframe>
39 Test passes if it does not crash. 30 Test passes if it does not crash.
40 </body> 31 </body>
41 </html> 32 </html>
42 33
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698