OLD | NEW |
1 <script src="/js-test-resources/js-test.js"></script> | 1 <script src="/js-test-resources/js-test.js"></script> |
2 <script> | 2 <script> |
3 | 3 |
4 if (window.testRunner) { | 4 if (window.testRunner) { |
5 » window.jsTestIsAsync = true; | 5 » testRunner.waitUntilDone(); |
6 testRunner.dumpAsText(); | 6 testRunner.dumpAsText(); |
7 } | 7 } |
8 | 8 |
9 function loaded() { | 9 function loaded() { |
10 // If the garbage collection causes the image load to stop and therefore
causes the load event to fire on the main frame, we failed. | 10 // If the garbage collection causes the image load to stop and therefore
causes the load event to fire on the main frame, we failed. |
11 alert("FAIL: The load event fired"); | 11 alert("FAIL: The load event fired"); |
12 » finishJSTest(); | 12 » |
| 13 » if (window.testRunner) |
| 14 » » testRunner.notifyDone(); |
13 } | 15 } |
14 | 16 |
15 </script> | 17 </script> |
16 <body onload="loaded();"> | 18 <body onload="loaded();"> |
17 | 19 |
18 This test has a form with an input type=image element in it. The form is wrappe
d in a div. It removes the div, forces garbage collection, and makes sure that
the window load event does not fire. It also makes sure there is no crash.<br> | 20 This test has a form with an input type=image element in it. The form is wrappe
d in a div. It removes the div, forces garbage collection, and makes sure that
the window load event does not fire. It also makes sure there is no crash.<br> |
19 <div id="thediv"> | 21 <div id="thediv"> |
20 <form> | 22 <form> |
21 <input type="image" src="resources/slowimage.php"> | 23 <input type="image" src="resources/slowimage.php"> |
22 </form> | 24 </form> |
23 </div> | 25 </div> |
24 </body> | 26 </body> |
25 <script> | 27 <script> |
26 | 28 |
27 function finished() { | 29 function finished() { |
28 window.stop() | 30 window.stop() |
29 » finishJSTest(); | 31 » if (window.testRunner) |
| 32 » » testRunner.notifyDone(); |
30 } | 33 } |
31 | 34 |
32 function forceGC() { | 35 function forceGC() { |
33 gc(); | 36 gc(); |
34 setTimeout("finished();", 0); | 37 setTimeout("finished();", 0); |
35 } | 38 } |
36 | 39 |
37 function removeTheDiv() { | 40 function removeTheDiv() { |
38 var element = window.document.getElementById("thediv"); | 41 var element = window.document.getElementById("thediv"); |
39 element.parentNode.removeChild(element); | 42 element.parentNode.removeChild(element); |
40 element = null; | 43 element = null; |
41 setTimeout("forceGC();", 0); | 44 setTimeout("forceGC();", 0); |
42 } | 45 } |
43 | 46 |
44 setTimeout("removeTheDiv();", 0); | 47 setTimeout("removeTheDiv();", 0); |
45 | 48 |
46 </script> | 49 </script> |
OLD | NEW |