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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-drawImage-animated-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body onload="javascript:ready()">
7
8 <!-- 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, 1 53, 30) -->
9 <img id="image" src="data:image/gif;base64,R0lGODlhAQABAIACAEAEHgqZHiH+E UNyZWF0ZWQgd2l0aCBHSU1QACH5BAkAAAEALAAAAAABAAEAAAICRAEAIfkECAAA/wAsAAAAAAEAAQAAA gJMAQA7" alt="Animated Image" />
10 <canvas id="canvas" width="1" height="1"></canvas>
11
12 <script>
13 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).");
14
15 function ready() {
16 var canvas = document.getElementById("canvas");
17 var image = document.getElementById("image");
18
19 var canvasContext = canvas.getContext("2d");
20
21 canvasContext.drawImage(image, 0, 0);
22
23 imageData = canvasContext.getImageData(0, 0, 1, 1);
24
25 shouldBe("imageData.data[0]", "64");
26 shouldBe("imageData.data[1]", "4");
27 shouldBe("imageData.data[2]", "30");
28 }
29 </script>
30
31 </body>
32 </html>
OLDNEW
« 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