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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-copyPixels.js

Issue 2675763005: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Addressing comments Created 3 years, 10 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
OLDNEW
(Empty)
1 description("Test if putImageData gives back the same result as getImageData");
2 var ctx = document.createElement('canvas').getContext('2d');
3
4 ctx.fillStyle = "red";
5 ctx.fillRect(0,0,50,20);
6 ctx.fillStyle = "green";
7 ctx.fillRect(50,0,50,20);
8 ctx.fillStyle = "blue";
9 ctx.fillRect(100,0,50,20);
10
11 var data = ctx.getImageData(0,0,150,20);
12 ctx.putImageData(data, 0, 20);
13
14 var imageData = ctx.getImageData(1, 21, 48, 18);
15 var imgdata = imageData.data;
16 shouldBe("imgdata[4]", "255");
17 shouldBe("imgdata[5]", "0");
18 shouldBe("imgdata[6]", "0");
19
20 imageData = ctx.getImageData(51, 21, 48, 18);
21 imgdata = imageData.data;
22 shouldBe("imgdata[4]", "0");
23 shouldBe("imgdata[5]", "128");
24 shouldBe("imgdata[6]", "0");
25
26 imageData = ctx.getImageData(101, 21, 48, 18);
27 imgdata = imageData.data;
28 shouldBe("imgdata[4]", "0");
29 shouldBe("imgdata[5]", "0");
30 shouldBe("imgdata[6]", "255");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698