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

Side by Side Diff: LayoutTests/fast/canvas/alpha.js

Issue 14298018: This CL implements the first draft of Canvas 2D Context Attributes, aka getContext('2d', { alpha: f… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: IDL cleanup Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 description("Series of tests for canvas alpha");
2
3 var canvas1 = document.getElementById("canvas1");
4 var canvas2 = document.getElementById("canvas2");
5 var ctx1 = canvas1.getContext("2d");
6 var ctx2 = canvas2.getContext("2d", { alpha: false } );
7 var imgData1 = ctx1.getImageData(0, 0, 1, 1);
8 shouldBe("ctx1.getContextAttributes().alpha", "true");
9 shouldBe("imgData1.data[0]", "0");
10 shouldBe("imgData1.data[1]", "0");
11 shouldBe("imgData1.data[2]", "0");
12 shouldBe("imgData1.data[3]", "0");
13 var imgData2 = ctx2.getImageData(0, 0, 1, 1);
14 shouldBe("ctx2.getContextAttributes().alpha", "false");
15 shouldBe("imgData2.data[0]", "0");
16 shouldBe("imgData2.data[1]", "0");
17 shouldBe("imgData2.data[2]", "0");
18 shouldBe("imgData2.data[3]", "255");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698