OLD | NEW |
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> |
OLD | NEW |