1 description("Test that drawImage() does nothing with an incomplete image or video");
4 testRunner.dumpAsText();
6 var canvas = document.createElement("canvas");
7 var ctx = canvas.getContext('2d');
9 ctx.fillRect(0,0,150,150);
11 var img = new Image();
12 img.src = '../../http/tests/misc/resources/image-slow.pl';
14 var video = document.createElement("video");
16 shouldBe("ctx.drawImage(img, 0, 0)", "undefined");
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");
24 shouldBe("ctx.drawImage(video, 0, 0)", "undefined");
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");