| if (window.internals && window.testRunner) { |
| internals.clearMemoryCache(); |
| internals.settings.setLargeImageAsyncDecodingEnabled(true); |
| internals.settings.setWebkitImageReadyEventEnabled(true); |
| testRunner.dumpAsText(true); |
| testRunner.waitUntilDone(); |
| PASS if no assertion failure |
| var img = document.getElementsByTagName('img')[0]; |
| img.onload = function() { |
| // Force layout and display so the image frame starts decoding. |
| document.body.offsetHeight; |
| img.addEventListener("webkitImageFrameReady", function() { |
| // Force the page to be displayed. The image element is already invalidated when the frame finished decoding. |
| // Change the width of the img element |
| // notifyDone() will force the last layout and display. |
| img.src = 'resources/animated-red-green-1000x1000-repeat-1.gif'; |