summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/images/animated-gif-advance-frames.html
blob: 0e63e4474273065f4b45f168ce879df4e92b8160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE HTML>
<img id="a" width="25" height="25" src="resources/green-red-blue-yellow-animated.gif?a">
<img id="b" width="25" height="25" src="resources/green-red-blue-yellow-animated.gif?b">
<img id="c" width="25" height="25" src="resources/green-red-blue-yellow-animated.gif?c">
<img id="d" width="25" height="25" src="resources/green-red-blue-yellow-animated.gif?d">
<img id="e" width="25" height="25" src="resources/green-red-blue-yellow-animated.gif?e">
<script>
if (window.testRunner)
  testRunner.waitUntilDone();

window.onload = function() {
  // Jump to the 2nd frame.
  window.internals.advanceImageAnimation(b);

  // Jump to the 3rd frame.
  for (var i = 0; i < 2; i++)
    window.internals.advanceImageAnimation(c);

  // Jump to the 4th frame.
  for (var i = 0; i < 3; i++)
    window.internals.advanceImageAnimation(d);

  // Ensure the animation can loop and get back to the first frame.
  for (var i = 0; i < 4; i++)
    window.internals.advanceImageAnimation(e);

  requestAnimationFrame(function() {
    if (window.testRunner)
      testRunner.notifyDone();
  });
}
</script>