| <html> |
| <script> |
| function runTest() { |
| if (window.layoutTestController) { |
| layoutTestController.dumpAsText(); |
| layoutTestController.waitUntilDone(); |
| } |
| |
| var image = new Image(); |
| |
| image.onload = function () { |
| document.getElementById('result').innerHTML = 'SUCCESS'; |
| |
| if (window.layoutTestController) |
| layoutTestController.notifyDone(); |
| } |
| |
| image.src = 'resources/blue_rect.jpg' |
| image = null; |
| |
| if (window.GCController) |
| GCController.collect(); |
| else { |
| // create lots of objects to force a garbage collection |
| var i = 0; |
| var s; |
| while (i < 5000) { |
| i = i + 1.11; |
| s = s + " "; |
| } |
| } |
| } |
| </script> |
| <body onload="runTest()"> |
| <div>This tests that an image element won't be garbage collected when it's loading, even if it doesn't have any references. |
| <div id="result">FAILURE</div> |
| </body> |
| </html> |