| OLD | NEW |
| (Empty) |
| 1 description("Test the behavior of CanvasRenderingContext2D.fillText() when calle
d with different numbers of arguments."); | |
| 2 | |
| 3 var ctx = document.createElement('canvas').getContext('2d'); | |
| 4 | |
| 5 function ExpectedNotEnoughArgumentsMessage(num) { | |
| 6 return "\"TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext
2D': 3 arguments required, but only " + num + " present.\""; | |
| 7 } | |
| 8 | |
| 9 shouldThrow("ctx.fillText()", ExpectedNotEnoughArgumentsMessage(0)); | |
| 10 shouldThrow("ctx.fillText('moo')", ExpectedNotEnoughArgumentsMessage(1)); | |
| 11 shouldThrow("ctx.fillText('moo',0)", ExpectedNotEnoughArgumentsMessage(2)); | |
| 12 shouldBe("ctx.fillText('moo',0,0)", "undefined"); | |
| 13 shouldBe("ctx.fillText('moo',0,0,0)", "undefined"); | |
| 14 shouldBe("ctx.fillText('moo',0,0,0,0)", "undefined"); | |
| OLD | NEW |