 Chromium Code Reviews
 Chromium Code Reviews Issue 1120963003:
  Implements getImageAnimationPolicy() at ImageLoader.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 1120963003:
  Implements getImageAnimationPolicy() at ImageLoader.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| Index: LayoutTests/accessibility/animation-policy.html | 
| diff --git a/LayoutTests/accessibility/animation-policy.html b/LayoutTests/accessibility/animation-policy.html | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..a29d765bdaa637077cf1391afc6f556251f64074 | 
| --- /dev/null | 
| +++ b/LayoutTests/accessibility/animation-policy.html | 
| @@ -0,0 +1,40 @@ | 
| +<script> | 
| +var updated = false; | 
| +var prevTime; | 
| +if (window.internals) | 
| + internals.settings.setImageAnimationPolicy("none"); | 
| + | 
| +if (window.testRunner) | 
| + testRunner.waitUntilDone(); | 
| + | 
| +function changeImage() { | 
| + document.getElementById("target").src = "animation-green.gif"; | 
| + updated = true; | 
| +} | 
| + | 
| +function timestamp() { | 
| + // Finish Test after 100ms after image is loaded | 
| + // to make sure that animation is not looped | 
| + // because animation policy is none. | 
| + if (Date.now() - prevTime > 100) { | 
| 
esprehn
2015/05/26 23:29:16
This is still a 100ms delay, you wan't put a 100ms
 | 
| + if (window.testRunner) | 
| + testRunner.notifyDone(); | 
| + } | 
| + window.requestAnimationFrame(timestamp); | 
| +} | 
| + | 
| +function imageLoaded() { | 
| + if (!updated) | 
| + return; | 
| + | 
| + if (window.testRunner) { | 
| + testRunner.layoutAndPaintAsyncThen(function () { | 
| + prevTime = Date.now(); | 
| + window.requestAnimationFrame(timestamp); | 
| + }); | 
| + } | 
| +} | 
| +</script> | 
| +<body onload="changeImage()"> | 
| +<img id="target" src="animation-blue.gif" onload="imageLoaded()"> | 
| +</body> |