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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-alphaImageData-behavior.js

Issue 2671853004: 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("Series of tests to ensure correct behaviour of getImageData and put ImageData when alpha is involved");
2 var ctx = document.getElementById('canvas').getContext('2d');
3 ctx.fillStyle = 'rgba(255, 0, 0, 0.01)';
4 ctx.fillRect(0, 0, 1, 200);
5 ctx.fillStyle = 'rgba(0, 255, 0, 0.995)';
6 ctx.fillRect(1, 0, 199, 200);
7 var imageData = ctx.getImageData(0, 0, 200, 200);
8 var imgdata = imageData.data;
9 shouldBe("imgdata[4]", "0");
10 shouldBe("imgdata[5]", "255");
11 shouldBe("imgdata[6]", "0");
12 shouldBe("imgdata[7]", "254");
13
14 ctx.putImageData(imageData, 0, 0);
15
16 imgdata = ctx.getImageData(0, 0, 200, 200).data;
17
18 shouldBe("imgdata[4]", "0");
19 shouldBe("imgdata[5]", "255");
20 shouldBe("imgdata[6]", "0");
21 shouldBe("imgdata[7]", "254");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698