| OLD | NEW |
| (Empty) |
| 1 description("Test the behavior of closePath on a path with a single point"); | |
| 2 var ctx = document.createElement('canvas').getContext('2d'); | |
| 3 | |
| 4 document.body.appendChild(ctx.canvas); | |
| 5 | |
| 6 ctx.strokeStyle = '#f00'; | |
| 7 ctx.lineWidth = 20; | |
| 8 | |
| 9 ctx.fillStyle = '#0f0'; | |
| 10 ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height); | |
| 11 | |
| 12 ctx.beginPath(); | |
| 13 ctx.moveTo(10, 10); | |
| 14 ctx.lineTo(100, 100); | |
| 15 ctx.closePath(); | |
| 16 ctx.stroke(); | |
| 17 | |
| 18 var imageData = ctx.getImageData(0, 0, 1, 1); | |
| 19 var imgdata = imageData.data; | |
| 20 shouldBe("imgdata[0]", "0"); | |
| 21 shouldBe("imgdata[1]", "255"); | |
| 22 shouldBe("imgdata[2]", "0"); | |
| 23 shouldBe("imgdata[3]", "255"); | |
| OLD | NEW |