Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Side by Side Diff: LayoutTests/accessibility/animation-policy.html

Issue 1120963003: Implements getImageAnimationPolicy() at ImageLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated TC without setTimeout Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 timestamp() {
16 // Finish Test after 100ms after image is loaded
17 // to make sure that animation is not looped
18 // because animation policy is none.
19 if (Date.now() - prevTime > 100) {
esprehn 2015/05/26 23:29:16 This is still a 100ms delay, you wan't put a 100ms
20 if (window.testRunner)
21 testRunner.notifyDone();
22 }
23 window.requestAnimationFrame(timestamp);
24 }
25
26 function imageLoaded() {
27 if (!updated)
28 return;
29
30 if (window.testRunner) {
31 testRunner.layoutAndPaintAsyncThen(function () {
32 prevTime = Date.now();
33 window.requestAnimationFrame(timestamp);
34 });
35 }
36 }
37 </script>
38 <body onload="changeImage()">
39 <img id="target" src="animation-blue.gif" onload="imageLoaded()">
40 </body>
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/animation-green.gif ('k') | LayoutTests/accessibility/animation-policy-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698