1 description("Test to ensure that canvas-to-canvas drawImage after a stroked rect works correctly.");
2 var canvas = document.createElement('canvas');
3 var ctx = canvas.getContext('2d');
7 ctx.strokeStyle = 'green';
8 ctx.strokeRect(0, 0, 100, 100);
10 var ctx2 = document.createElement('canvas').getContext('2d');
12 ctx2.fillStyle = 'red';
13 ctx2.fillRect(0, 0, 100, 100);
14 ctx2.drawImage(canvas, 0, 0);
15 var imageData = ctx2.getImageData(0, 0, 1, 1);
16 var imgdata = imageData.data;
17 shouldBe("imgdata[0]", "0");
18 shouldBe("imgdata[1]", "128");
19 shouldBe("imgdata[2]", "0");