| OLD | NEW |
| (Empty) |
| 1 <body onload="test()"> | |
| 2 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=34490">bug 34490<a/
>: | |
| 3 WebCore::ImageEventSender::dispatchPendingEvents() crashes in certain conditions
.</p> | |
| 4 <div id="testRun"></div> | |
| 5 <div id="container"></div> | |
| 6 <script> | |
| 7 if (window.testRunner) { | |
| 8 testRunner.waitUntilDone(); | |
| 9 testRunner.dumpAsText(); | |
| 10 } | |
| 11 | |
| 12 function gc() | |
| 13 { | |
| 14 if (window.GCController) | |
| 15 return GCController.collect(); | |
| 16 | |
| 17 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires
about 9K allocations before a collect) | |
| 18 var s = new String("abc"); | |
| 19 } | |
| 20 } | |
| 21 | |
| 22 var container = document.getElementById("container"); | |
| 23 var testRunDiv = document.getElementById("testRun"); | |
| 24 var remainingTestRuns = 30; | |
| 25 | |
| 26 function test() | |
| 27 { | |
| 28 testRunDiv.innerHTML = remainingTestRuns; | |
| 29 | |
| 30 if (--remainingTestRuns < 0) { | |
| 31 testRunDiv.innerHTML = "PASS"; | |
| 32 if (window.testRunner) | |
| 33 testRunner.notifyDone(); | |
| 34 return; | |
| 35 } | |
| 36 | |
| 37 container.innerHTML = '<img src="resources/boston.gif" onload="loaded1()">'
+ | |
| 38 '<img src="resources/boston.gif" onload="loaded2()">'; | |
| 39 } | |
| 40 | |
| 41 function loaded1() | |
| 42 { | |
| 43 var img2 = document.getElementsByTagName("img")[1]; | |
| 44 img2.src = ""; | |
| 45 container.removeChild(img2); | |
| 46 img2 = null; | |
| 47 gc(); | |
| 48 setTimeout(test, 0); | |
| 49 } | |
| 50 | |
| 51 function loaded2() | |
| 52 { | |
| 53 } | |
| 54 </script> | |
| 55 </body> | |
| OLD | NEW |