1 description("Series of tests to ensure that no gradient is drawn without path");
2 var ctx = document.createElement('canvas').getContext('2d');
4 ctx.fillStyle = 'green';
5 ctx.fillRect(0, 0, 100, 100);
7 var gradient = ctx.createLinearGradient(0, 0, 0, 100);
8 gradient.addColorStop(1, 'red');
9 ctx.fillStyle = gradient;
13 var imageData = ctx.getImageData(1, 1, 98, 98);
14 var imgdata = imageData.data;
15 shouldBe("imgdata[4]", "0");
16 shouldBe("imgdata[5]", "128");
17 shouldBe("imgdata[6]", "0");
19 ctx.strokeStyle = 'green';
21 ctx.strokeRect(50, 0, 100, 100);
23 ctx.strokeStyle = gradient;
27 imageData = ctx.getImageData(1, 1, 98, 98);
28 imgdata = imageData.data;
29 shouldBe("imgdata[4]", "0");
30 shouldBe("imgdata[5]", "128");
31 shouldBe("imgdata[6]", "0");