Index: LayoutTests/fast/canvas/alpha.js |
diff --git a/LayoutTests/fast/canvas/alpha.js b/LayoutTests/fast/canvas/alpha.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a3c282acfe302d254b385f96a46f77931a48e0a1 |
--- /dev/null |
+++ b/LayoutTests/fast/canvas/alpha.js |
@@ -0,0 +1,25 @@ |
+description("Series of tests for canvas alpha"); |
+ |
+var canvas1 = document.getElementById("canvas1"); |
+var canvas2 = document.getElementById("canvas2"); |
+var ctx1 = canvas1.getContext("2d"); |
+var ctx2 = canvas2.getContext("2d", { alpha: false } ); |
+var ctx3 = canvas3.getContext("2d", {} ); |
+var imgData1 = ctx1.getImageData(0, 0, 1, 1); |
+shouldBe("ctx1.getContextAttributes().alpha", "true"); |
+shouldBe("imgData1.data[0]", "0"); |
+shouldBe("imgData1.data[1]", "0"); |
+shouldBe("imgData1.data[2]", "0"); |
+shouldBe("imgData1.data[3]", "0"); |
+var imgData2 = ctx2.getImageData(0, 0, 1, 1); |
+shouldBe("ctx2.getContextAttributes().alpha", "false"); |
+shouldBe("imgData2.data[0]", "0"); |
+shouldBe("imgData2.data[1]", "0"); |
+shouldBe("imgData2.data[2]", "0"); |
+shouldBe("imgData2.data[3]", "255"); |
+var imgData3 = ctx3.getImageData(0, 0, 1, 1); |
+shouldBe("ctx3.getContextAttributes().alpha", "true"); |
+shouldBe("imgData3.data[0]", "0"); |
+shouldBe("imgData3.data[1]", "0"); |
+shouldBe("imgData3.data[2]", "0"); |
+shouldBe("imgData3.data[3]", "0"); |