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