OLD | NEW |
1 description("Test the behavior of CanvasRenderingContext2D.drawImage() when call
ed with different numbers of arguments."); | 1 description("Test the behavior of CanvasRenderingContext2D.drawImage() when call
ed with different numbers of arguments."); |
2 | 2 |
3 var ctx = document.createElement('canvas').getContext('2d'); | 3 var ctx = document.createElement('canvas').getContext('2d'); |
4 | 4 |
5 var imageElement = document.createElement("img"); | 5 var imageElement = document.createElement("img"); |
6 shouldThrow("ctx.drawImage()"); | 6 shouldThrow("ctx.drawImage()"); |
7 shouldThrow("ctx.drawImage(imageElement)"); | 7 shouldThrow("ctx.drawImage(imageElement)"); |
8 shouldThrow("ctx.drawImage(imageElement, 0)"); | 8 shouldThrow("ctx.drawImage(imageElement, 0)"); |
9 shouldBe("ctx.drawImage(imageElement, 0, 0)", "undefined"); | 9 shouldBe("ctx.drawImage(imageElement, 0, 0)", "undefined"); |
10 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0)"); | 10 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0)"); |
11 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0)", "undefined"); | 11 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0)", "undefined"); |
12 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0)"); | 12 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0)"); |
13 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0)"); | 13 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0)"); |
14 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0)"); | 14 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0)"); |
15 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined"); | 15 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined"); |
16 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); | 16 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined"); |
17 shouldThrow("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); | 17 shouldBe("ctx.drawImage(imageElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined
"); |
18 | 18 |
19 var canvasElement = document.createElement("canvas"); | 19 var canvasElement = document.createElement("canvas"); |
20 shouldThrow("ctx.drawImage(canvasElement)"); | 20 shouldThrow("ctx.drawImage(canvasElement)"); |
21 shouldThrow("ctx.drawImage(canvasElement, 0)"); | 21 shouldThrow("ctx.drawImage(canvasElement, 0)"); |
22 shouldBe("ctx.drawImage(canvasElement, 0, 0)", "undefined"); | 22 shouldBe("ctx.drawImage(canvasElement, 0, 0)", "undefined"); |
23 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0)"); | 23 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0)"); |
24 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0)", "undefined"); | 24 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0)", "undefined"); |
25 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0)"); | 25 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0)"); |
26 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0)"); | 26 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0)"); |
27 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0)"); | 27 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0)"); |
28 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined"); | 28 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined"); |
29 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); | 29 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefined")
; |
30 shouldThrow("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"); | 30 shouldBe("ctx.drawImage(canvasElement, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", "undefine
d"); |
OLD | NEW |