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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/StyleSheet/removed-media-rule-deleted-parent-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 { 6 {
6 testRunner.dumpAsText(); 7 testRunner.dumpAsText();
7 testRunner.waitUntilDone(); 8 testRunner.waitUntilDone();
8 } 9 }
9 10
10 function runTest() 11 function runTest()
11 { 12 {
12 style = document.createElement('style'); 13 style = document.createElement('style');
13 style.textContent = '@media all { body { color: red } }'; 14 style.textContent = '@media all { body { color: red } }';
14 document.head.appendChild(style); 15 document.head.appendChild(style);
15
16 ruleList = getMatchedCSSRules(document.body); 16 ruleList = getMatchedCSSRules(document.body);
17 17
18 document.styleSheets[0].cssRules[0].deleteRule(0); 18 document.styleSheets[0].cssRules[0].deleteRule(0);
19 document.head.removeChild(style); 19 document.head.removeChild(style);
20 20
21 gc(); 21 gc();
22 22
23 if (!ruleList[0].parentStyleSheet) 23 if (!ruleList[0].parentStyleSheet)
24 document.getElementById('result').innerHTML = "PASS"; 24 document.getElementById('result').innerHTML = "PASS";
25 if (window.testRunner) 25 if (window.testRunner)
26 testRunner.notifyDone(); 26 testRunner.notifyDone();
27 } 27 }
28 28
29 function gc()
30 {
31 if (window.GCController)
32 return GCController.collect();
33
34 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
35 var s = new String("abc");
36 }
37 }
38 </script> 29 </script>
39 </head> 30 </head>
40 <body onload="runTest()"> 31 <body onload="runTest()">
41 <div id="result"></div> 32 <div id="result"></div>
42 </body> 33 </body>
43 </html> 34 </html>
44 35
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698