| OLD | NEW |
| 1 description("Test the behavior of CanvasRenderingContext2D.setFillColor() when c
alled with different numbers of arguments."); | 1 description("Test the behavior of CanvasRenderingContext2D.setFillColor() when c
alled 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 function ExpectedNotEnoughArgumentsMessage(num) { | 5 shouldThrow("ctx.setFillColor()"); |
| 6 return "\"TypeError: Failed to execute 'setFillColor' on 'CanvasRenderingCon
text2D': 1 argument required, but only " + num + " present.\""; | |
| 7 } | |
| 8 | |
| 9 var TypeError = '"TypeError: Failed to execute \'setFillColor\' on \'CanvasRende
ringContext2D\': No function was found that matched the signature provided."'; | |
| 10 | |
| 11 shouldThrow("ctx.setFillColor()", ExpectedNotEnoughArgumentsMessage(0)); | |
| 12 shouldBe("ctx.setFillColor('red')", "undefined"); | 6 shouldBe("ctx.setFillColor('red')", "undefined"); |
| 13 shouldBe("ctx.setFillColor(0)", "undefined"); | 7 shouldBe("ctx.setFillColor(0)", "undefined"); |
| 14 shouldBe("ctx.setFillColor(0, 0)", "undefined"); | 8 shouldBe("ctx.setFillColor(0, 0)", "undefined"); |
| 15 shouldThrow("ctx.setFillColor(0, 0, 0)", "TypeError"); | 9 shouldThrow("ctx.setFillColor(0, 0, 0)"); |
| 16 shouldBe("ctx.setFillColor(0, 0, 0, 0)", "undefined"); | 10 shouldBe("ctx.setFillColor(0, 0, 0, 0)", "undefined"); |
| 17 shouldBe("ctx.setFillColor(0, 0, 0, 0, 0)", "undefined"); | 11 shouldBe("ctx.setFillColor(0, 0, 0, 0, 0)", "undefined"); |
| 18 shouldThrow("ctx.setFillColor(0, 0, 0, 0, 0, 0)", "TypeError"); | 12 shouldThrow("ctx.setFillColor(0, 0, 0, 0, 0, 0)"); |
| OLD | NEW |