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

Side by Side Diff: LayoutTests/fast/css/giant-stylesheet-crash.html

Issue 38293002: Explicit GC of strings to avoid test timeout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on top of CRLF -> LF change. Created 7 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/fast/css/visited-link-hang.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 <head> 1 <head>
2 <script> 2 <script>
3 // GC unreferenced strings to avoid that this test times out.
4 if (window.GCController)
5 GCController.collect();
6
3 if (window.testRunner) 7 if (window.testRunner)
4 testRunner.dumpAsText(); 8 testRunner.dumpAsText();
5 </script> 9 </script>
6 10
7 <script> 11 <script>
8 var styleElement = document.createElement('style'); 12 var styleElement = document.createElement('style');
9 styleElement.setAttribute('type', 'text/css'); 13 styleElement.setAttribute('type', 'text/css');
10 14
11 var str="z"; 15 var str="z";
12 for (var i = 0; i < 16; i++) { 16 for (var i = 0; i < 16; i++) {
13 str += str; 17 str += str;
14 } 18 }
15 for (var i = 0; i < 1+(1<<16); i++){ 19 for (var i = 0; i < 1+(1<<16); i++){
16 var txt = document.createTextNode(str); 20 var txt = document.createTextNode(str);
17 styleElement.appendChild(txt); 21 styleElement.appendChild(txt);
18 } 22 }
19 23
20 document.getElementsByTagName('head')[0].appendChild(styleElement); 24 str = null;
25
26 // GC the large str strings to avoid timeouts for subsequent tests.
27 if (window.GCController)
28 GCController.collect();
29
30 document.getElementsByTagName('head')[0].appendChild(styleElement);
21 </script> 31 </script>
22 </head> 32 </head>
23 <body> 33 <body>
24 This test verifies that creating a huge inline stylesheet doesn't crash. 34 This test verifies that creating a huge inline stylesheet doesn't crash.
25 </body> 35 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/visited-link-hang.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698