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

Unified Diff: LayoutTests/fast/images/animated-gif-advance-frames.html

Issue 1304093006: Add a new API for testing animated images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase harder Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/images/animated-gif-advance-frames.html
diff --git a/LayoutTests/fast/images/animated-gif-advance-frames.html b/LayoutTests/fast/images/animated-gif-advance-frames.html
new file mode 100644
index 0000000000000000000000000000000000000000..0e63e4474273065f4b45f168ce879df4e92b8160
--- /dev/null
+++ b/LayoutTests/fast/images/animated-gif-advance-frames.html
@@ -0,0 +1,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>

Powered by Google App Engine
This is Rietveld 408576698