OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 var updated = false; |
| 3 var prevTime; |
| 4 if (window.internals) |
| 5 internals.settings.setImageAnimationPolicy("none"); |
| 6 |
| 7 if (window.testRunner) |
| 8 testRunner.waitUntilDone(); |
| 9 |
| 10 function changeImage() { |
| 11 document.getElementById("target").src = "animation-green.gif"; |
| 12 updated = true; |
| 13 } |
| 14 |
| 15 function finishTest() { |
| 16 if (window.testRunner) |
| 17 testRunner.notifyDone(); |
| 18 } |
| 19 |
| 20 function imageLoaded() { |
| 21 if (!updated) |
| 22 return; |
| 23 |
| 24 var img = document.getElementById("target"); |
| 25 if (window.internals) |
| 26 internals.advanceTimeForImage(img, 0.1); |
| 27 |
| 28 if (window.testRunner) { |
| 29 testRunner.layoutAndPaintAsyncThen(function () { |
| 30 window.requestAnimationFrame(finishTest); |
| 31 }); |
| 32 } |
| 33 } |
| 34 </script> |
| 35 <body onload="changeImage()"> |
| 36 <img id="target" src="animation-blue.gif" onload="imageLoaded()"> |
| 37 </body> |
OLD | NEW |