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

Unified Diff: LayoutTests/canvas/philip/tests/2d.drawImage.animated.gif.html

Issue 1304093006: Add a new API for testing animated images (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup tests 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/canvas/philip/tests/2d.drawImage.animated.gif.html
diff --git a/LayoutTests/canvas/philip/tests/2d.drawImage.animated.gif.html b/LayoutTests/canvas/philip/tests/2d.drawImage.animated.gif.html
index 44dc495d1b5f25b3992494140b63f833004f887f..7369aff26369de826c57ae0749dfdc6312f80762 100644
--- a/LayoutTests/canvas/philip/tests/2d.drawImage.animated.gif.html
+++ b/LayoutTests/canvas/philip/tests/2d.drawImage.animated.gif.html
@@ -13,11 +13,14 @@
_addTest(function(canvas, ctx) {
deferTest();
-setTimeout(wrapFunction(function () {
+
+// Advance the animation one frame to ensure we only draw the first frame.
+window.internals.advanceImageAnimation(document.getElementById('anim-gr.gif'));
+
+requestAnimationFrame(wrapFunction(function () {
ctx.drawImage(document.getElementById('anim-gr.gif'), 0, 0);
_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
-}), 500);
-
+}));
});
</script>

Powered by Google App Engine
This is Rietveld 408576698