| OLD | NEW |
| (Empty) |
| 1 description("Series of tests to ensure correct behavior of canvas.fillRect()."); | |
| 2 var ctx = document.createElement('canvas').getContext('2d'); | |
| 3 | |
| 4 // Fill rect with height = width = 0. | |
| 5 debug("Test canvas.fillRect() with height = width = 0."); | |
| 6 ctx.fillStyle = 'red'; | |
| 7 ctx.fillRect(0, 0, 0, 0); | |
| 8 | |
| 9 var imageData = ctx.getImageData(0, 0, 1, 1); | |
| 10 var imgdata = imageData.data; | |
| 11 shouldBe("imgdata[0]", "0"); | |
| 12 shouldBe("imgdata[1]", "0"); | |
| 13 shouldBe("imgdata[2]", "0"); | |
| 14 | |
| 15 ctx.clearRect(0, 0, 1, 1); | |
| 16 | |
| 17 // Fill rect with height = 0, width = 1. | |
| 18 debug("Test canvas.fillRect() with height = 0, width = 1."); | |
| 19 ctx.fillStyle = 'red'; | |
| 20 ctx.fillRect(0, 0, 1, 0); | |
| 21 | |
| 22 var imageData = ctx.getImageData(0, 0, 1, 1); | |
| 23 var imgdata = imageData.data; | |
| 24 shouldBe("imgdata[0]", "0"); | |
| 25 shouldBe("imgdata[1]", "0"); | |
| 26 shouldBe("imgdata[2]", "0"); | |
| 27 | |
| 28 ctx.clearRect(0, 0, 1, 1); | |
| 29 | |
| 30 // Fill rect with height = 1, width = 0. | |
| 31 debug("Test canvas.fillRect() with height = 1, width = 0."); | |
| 32 ctx.fillStyle = 'red'; | |
| 33 ctx.fillRect(0, 0, 0, 1); | |
| 34 | |
| 35 var imageData = ctx.getImageData(0, 0, 1, 1); | |
| 36 var imgdata = imageData.data; | |
| 37 shouldBe("imgdata[0]", "0"); | |
| 38 shouldBe("imgdata[1]", "0"); | |
| 39 shouldBe("imgdata[2]", "0"); | |
| 40 | |
| 41 ctx.clearRect(0, 0, 1, 1); | |
| OLD | NEW |