Unreviewed, rolling out r182247.
[WebKit-https.git] / LayoutTests / fast / dom / HTMLImageElement / image-loading-gc.html
1 <html>
2 <script>
3 function runTest() {
4     if (window.testRunner) {
5         testRunner.dumpAsText();
6         testRunner.waitUntilDone();
7     }
8     
9     var image = new Image();
10     
11     image.onload = function () {
12         document.getElementById('result').innerHTML = 'SUCCESS';
13         
14         if (window.testRunner) 
15             testRunner.notifyDone();
16     }
17     
18     image.src = 'resources/blue_rect.jpg'
19     image = null;
20     
21     if (window.GCController)
22         GCController.collect();
23     else {
24         // create lots of objects to force a garbage collection
25         var i = 0;
26         var s;
27         while (i < 5000) {
28             i = i + 1.11;
29             s = s + " ";
30         }
31     }
32 }
33 </script>
34 <body onload="runTest()">
35 <div>This tests that an image element won't be garbage collected when it's loading, even if it doesn't have any references.
36 <div id="result">FAILURE</div>
37 </body>
38 </html>