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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg.html

Issue 1890613002: Support createImageBitmap from a SVG image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const Created 4 years, 8 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 | third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg-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>
7 <script>
8
9 description("Test createImageBitmap from a SVG image.");
10 window.jsTestIsAsync = true;
11
12 function shouldBeBlue(x, y) {
13 d = ctx.getImageData(x, y, 1, 1).data;
14 shouldBe("d[0]", "0");
sof 2016/04/14 19:29:26 shouldBeEqualToNumber("d[0]", 0); etc.
15 shouldBe("d[1]", "0");
16 shouldBe("d[2]", "255");
17 shouldBe("d[3]", "255");
18 }
19
20 var canvas = document.createElement("canvas");
21 canvas.setAttribute("width", "200");
22 canvas.setAttribute("height", "200");
23 var ctx = canvas.getContext("2d");
24 var bitmap;
25
26 var image = new Image();
27 image.onload = function() {
28 createImageBitmap(image).then(function(imageBitmap) {
29 bitmap = imageBitmap;
30 shouldBe("bitmap.width", "200");
31 shouldBe("bitmap.height", "200");
32 ctx.clearRect(0, 0, 200, 200);
33 ctx.drawImage(imageBitmap, 0, 0);
34 shouldBeBlue(0, 0);
35 shouldBeBlue(0, 199);
36 shouldBeBlue(199, 0);
37 shouldBeBlue(199, 199);
38 finishJSTest();
39 }, function (e) {
40 testFailed("createImageBitmap promise rejected: " + e);
41 finishJSTest();
42 });
43 }
44 image.src = '../../svg/as-image/resources/200x200-blue-rect.svg';
45
46 </script>
47 </body>
48 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-svg-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698