OLD | NEW |
(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> |
OLD | NEW |