OLD | NEW |
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 | 7 |
7 function gc() { | |
8 if (window.GCController) | |
9 return GCController.collect(); | |
10 | |
11 for (var i = 0; i < 10000; i++) | |
12 var s = new String("abc"); | |
13 } | |
14 | |
15 function crash_test(element_name) { | 8 function crash_test(element_name) { |
16 var element = document.createElement(element_name); | 9 var element = document.createElement(element_name); |
17 element.setAttribute('form', '1'); | 10 element.setAttribute('form', '1'); |
18 var container = document.createElement('div'); | 11 var container = document.createElement('div'); |
19 container.appendChild(element); | 12 container.appendChild(element); |
20 document.implementation.createDocument(null, '').adoptNode(container); | 13 document.implementation.createDocument(null, '').adoptNode(container); |
21 container.removeChild(element); | 14 container.removeChild(element); |
22 delete element; | 15 delete element; |
23 gc(); | 16 gc(); |
24 var form = document.createElement('form'); | 17 var form = document.createElement('form'); |
25 form.setAttribute('id', '2'); | 18 form.setAttribute('id', '2'); |
26 document.body.appendChild(form) | 19 document.body.appendChild(form) |
27 } | 20 } |
28 | 21 |
29 function test() { | 22 function test() { |
30 crash_test('input'); | 23 crash_test('input'); |
31 crash_test('object'); | 24 crash_test('object'); |
32 document.body.innerHTML += "PASS"; | 25 document.body.innerHTML += "PASS"; |
33 } | 26 } |
34 </script> | 27 </script> |
35 </head> | 28 </head> |
36 <body onload="test()"> | 29 <body onload="test()"> |
37 <p> | 30 <p> |
38 This page is a test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=51
418">Bug 51418</a>. WebKit should not crash when this page is loaded. | 31 This page is a test case for <a href="https://bugs.webkit.org/show_bug.cgi?id=51
418">Bug 51418</a>. WebKit should not crash when this page is loaded. |
39 </p> | 32 </p> |
40 </body> | 33 </body> |
41 </html> | 34 </html> |
OLD | NEW |