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

Unified Diff: LayoutTests/fast/canvas/canvas-drawImage-animated.html

Issue 388253004: Drawing an animated image to a canvas now behave as expected (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrections according to comments + rebase master Created 6 years, 5 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
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-drawImage-animated-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/canvas-drawImage-animated.html
diff --git a/LayoutTests/fast/canvas/canvas-drawImage-animated.html b/LayoutTests/fast/canvas/canvas-drawImage-animated.html
new file mode 100644
index 0000000000000000000000000000000000000000..d870a130fb5f97ff44a39bc1679396f6fb734976
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-drawImage-animated.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+ <head>
+ <script src="../../resources/js-test.js"></script>
+ </head>
+ <body onload="javascript:ready()">
+
+ <!-- This image is an animated GIF (1px by 1px). Animation time is 0ms. First frame has the color rgb(64, 4, 30). The second one has the color rgb(10, 153, 30) -->
+ <img id="image" src="data:image/gif;base64,R0lGODlhAQABAIACAEAEHgqZHiH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAkAAAEALAAAAAABAAEAAAICRAEAIfkECAAA/wAsAAAAAAEAAQAAAgJMAQA7" alt="Animated Image" />
+ <canvas id="canvas" width="1" height="1"></canvas>
+
+ <script>
+ description("When drawing an animated image to a canvas, the poster frame (or the first frame) should be printed.<br/>This test passes if the canvas is filled with the color rgb(64, 4, 30).");
+
+ function ready() {
+ var canvas = document.getElementById("canvas");
+ var image = document.getElementById("image");
+
+ var canvasContext = canvas.getContext("2d");
+
+ canvasContext.drawImage(image, 0, 0);
+
+ imageData = canvasContext.getImageData(0, 0, 1, 1);
+
+ shouldBe("imageData.data[0]", "64");
+ shouldBe("imageData.data[1]", "4");
+ shouldBe("imageData.data[2]", "30");
+ }
+ </script>
+
+ </body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-drawImage-animated-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698