Chromium Code Reviews| Index: LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html |
| diff --git a/LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html b/LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..411b032c07994bada95a6303d01f43d71d06fe1a |
| --- /dev/null |
| +++ b/LayoutTests/fast/canvas/canvas-createImageBitmap-animated.html |
| @@ -0,0 +1,33 @@ |
| +<html> |
| +<body> |
| +<canvas id="c"></canvas> |
| +<script> |
| + if (window.testRunner) |
| + testRunner.waitUntilDone(); |
| + |
| + function finishTest() { |
| + if (window.testRunner) |
| + testRunner.notifyDone(); |
| + } |
| + |
| + var canvas = document.getElementById("c"); |
| + canvas.setAttribute("width", "200"); |
|
Justin Novosad
2013/08/07 18:56:55
canvas.width = 200;
|
| + canvas.setAttribute("height", "200"); |
| + var ctx = canvas.getContext("2d"); |
| + |
| + var img = new Image(); |
| + img.src = 'resources/green-red-animated.gif'; |
| + img.onload = imageLoaded(); |
| + |
| + function imageLoaded() { |
| + window.setTimeout(function() { |
| + createImageBitmap(img).then(function (imageBitmap) { |
| + ctx.drawImage(imageBitmap, 0, 0); |
|
Justin Novosad
2013/08/07 18:56:55
Instead of implementing this as a ref test, it cou
|
| + finishTest(); |
| + }, finishTest); |
| + }, 200); |
|
Justin Novosad
2013/08/07 18:56:55
This 200ms seems to come out of nowhere. I think
|
| + } |
| +</script> |
| +<p>A green square should be visible.</p> |
| +</body> |
| +</html> |