Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-animated.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-animated.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-animated.html |
| index 454f9400818d6ad599731609a718ae38846fddb1..bbd27ccdfc1e073f091fa8a8eb2cddbf790c5bb6 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-animated.html |
| +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-animated.html |
| @@ -1,44 +1,27 @@ |
| -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| -<html> |
| - <head> |
| - <script src="../../resources/js-test.js"></script> |
| - </head> |
| - <body onload="javascript:ready()"> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| + |
| +<!-- 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> |
| +async_test(t => { |
| + window.onload = function() { |
|
Justin Novosad
2017/02/14 20:22:05
Indent is weird.
zakerinasab
2017/02/15 14:53:02
Fixed.
|
| + var canvas = document.getElementById("canvas"); |
| + var image = document.getElementById("image"); |
| + var canvasContext = canvas.getContext("2d"); |
| + t.step(function(){ |
| + canvasContext.drawImage(image, 0, 0); |
| + imageData = canvasContext.getImageData(0, 0, 1, 1); |
| + assert_equals(imageData.data[0], 64); |
| + assert_equals(imageData.data[1], 4); |
| + assert_equals(imageData.data[2], 30); |
| + }); |
| + t.done(); |
| + } |
| +}, 'When drawing an animated image to a canvas, the poster frame (or the first frame) should be printed. This test passes if the canvas is filled with the color rgb(64, 4, 30).'); |
| +</script> |
| +</body> |
| - <!-- 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)."); |
| - |
| - if (window.testRunner) { |
| - testRunner.waitUntilDone(); |
| - } |
| - |
| - |
| - function ready() { |
| - var canvas = document.getElementById("canvas"); |
| - var image = document.getElementById("image"); |
| - |
| - var canvasContext = canvas.getContext("2d"); |
| - |
| - window.setTimeout(function() { |
| - |
| - 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"); |
| - |
| - if (window.testRunner) |
| - testRunner.notifyDone(); |
| - |
| - }, 200); |
| - } |
| - </script> |
| - |
| - </body> |
| -</html> |