1 description("Some tests for Canvas shadows");
2 var ctx = document.createElement('canvas').getContext('2d');
4 ctx.fillStyle = "green";
5 ctx.fillRect(0,0,100,100);
7 ctx.shadowColor = "green";
12 var imageData = ctx.getImageData(0, 0, 200, 50);
13 var imgdata = imageData.data;
14 shouldBe("imgdata[4]", "0");
15 shouldBe("imgdata[5]", "128");
16 shouldBe("imgdata[6]", "0");
18 ctx.clearRect(0,0,200,50);
20 ctx.shadowColor = "green";
21 ctx.shadowOffsetX = 100;
22 ctx.shadowOffsetY = 0;
25 ctx.fillStyle = "green";
26 ctx.fillRect(0,0,100,50);
28 imageData = ctx.getImageData(110, 10, 80, 30);
29 imgdata = imageData.data;
30 shouldBe("imgdata[4]", "0");
31 shouldBe("imgdata[5]", "128");
32 shouldBe("imgdata[6]", "0");