| OLD | NEW |
| (Empty) |
| 1 description("Test that drawImage() does nothing with an incomplete image or vide
o"); | |
| 2 | |
| 3 if (window.testRunner) | |
| 4 testRunner.dumpAsText(); | |
| 5 | |
| 6 var canvas = document.createElement("canvas"); | |
| 7 var ctx = canvas.getContext('2d'); | |
| 8 ctx.fillStyle = 'red'; | |
| 9 ctx.fillRect(0,0,150,150); | |
| 10 | |
| 11 var img = new Image(); | |
| 12 img.src = '../../http/tests/misc/resources/image-slow.pl'; | |
| 13 | |
| 14 var video = document.createElement("video"); | |
| 15 | |
| 16 shouldBe("ctx.drawImage(img, 0, 0)", "undefined"); | |
| 17 | |
| 18 var imgdata = ctx.getImageData(0, 0, 1, 1).data; | |
| 19 shouldBe("imgdata[0]", "255"); | |
| 20 shouldBe("imgdata[1]", "0"); | |
| 21 shouldBe("imgdata[2]", "0"); | |
| 22 shouldBe("imgdata[3]", "255"); | |
| 23 | |
| 24 shouldBe("ctx.drawImage(video, 0, 0)", "undefined"); | |
| 25 | |
| 26 imgdata = ctx.getImageData(0, 0, 1, 1).data; | |
| 27 shouldBe("imgdata[0]", "255"); | |
| 28 shouldBe("imgdata[1]", "0"); | |
| 29 shouldBe("imgdata[2]", "0"); | |
| 30 shouldBe("imgdata[3]", "255"); | |
| OLD | NEW |