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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-getImageData-negative-source.js

Issue 2674933002: Use testharness.js instead of js-test.js in LayoutTests/fast/canvas tests. (Closed)
Patch Set: Corrections 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 the handling of negative sourceRect offset in getImageData()." );
2
3 ctx = document.createElement('canvas').getContext('2d');
4
5 ctx.fillStyle = 'red';
6 ctx.fillRect(0, 0, 100, 100);
7 ctx.fillStyle = 'green';
8 ctx.fillRect(0, 0, 6, 6);
9
10 var imageData = ctx.getImageData(-10, 0, 100, 1);
11 var imgdata = imageData.data;
12
13 // Fully transparent black
14 shouldBe("imgdata[0]", "0");
15 shouldBe("imgdata[1]", "0");
16 shouldBe("imgdata[2]", "0");
17 shouldBe("imgdata[3]", "0");
18
19 // Green
20 shouldBe("imgdata[60]", "0");
21 shouldBe("imgdata[61]", "128");
22 shouldBe("imgdata[62]", "0");
23 shouldBe("imgdata[63]", "255");
24
25 // Red
26 shouldBe("imgdata[64]", "255");
27 shouldBe("imgdata[65]", "0");
28 shouldBe("imgdata[66]", "0");
29 shouldBe("imgdata[67]", "255");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698