Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / canvas / canvas-createImageBitmap-animated.html
blobe6acaeb6c6833d9f6086a170a26d1fac96347c9a
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <script>
7 window.jsTestIsAsync = true;
9 function shouldBeGreen(x, y) {
10 d = ctx.getImageData(x, y, 1, 1).data;
11 shouldBeTrue("d[0] == 0");
12 shouldBeTrue("d[1] == 255");
13 shouldBeTrue("d[2] == 0");
14 shouldBeTrue("d[3] == 255");
17 var canvas = document.createElement("canvas");
18 canvas.width = 200;
19 canvas.height = 200;
20 var ctx = canvas.getContext("2d");
22 var img = new Image();
23 img.onload = imageLoaded;
24 img.src = 'resources/green-red-animated.gif';
26 function imageLoaded() {
27 // If the ImageBitmap is green, we know that it is a snapshot of the gif's 0th frame.
28 window.internals.advanceImageAnimation(img);
29 createImageBitmap(img).then(function (imageBitmap) {
30 ctx.drawImage(imageBitmap, 0, 0);
31 shouldBeGreen(100, 100);
32 finishJSTest();
33 }, function() {
34 testFailed("Promise was rejected.");
35 finishJSTest();
36 });
38 </script>
39 </body>
40 </html>