Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLImageElement / image-loading-gc.html
blob7203500d031315e1cde0cfb9c4f5ca948b8f1938
1 <html>
2 <script>
3 function runTest() {
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
9 var image = new Image();
11 image.onload = function () {
12 document.getElementById('result').innerHTML = 'SUCCESS';
14 if (window.testRunner)
15 testRunner.notifyDone();
18 image.src = 'resources/blue_rect.jpg'
19 image = null;
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 + " ";
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>