1 description("Test the behavior of CanvasRenderingContext2D.strokeText() when called with different numbers of arguments.");
3 var ctx = document.createElement('canvas').getContext('2d');
5 function ExpectedMessage(num) {
6 return "\"TypeError: Failed to execute 'strokeText' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\"";
9 shouldThrow("ctx.strokeText()", ExpectedMessage(0));
10 shouldThrow("ctx.strokeText('moo')", ExpectedMessage(1));
11 shouldThrow("ctx.strokeText('moo',0)", ExpectedMessage(2));
12 shouldBe("ctx.strokeText('moo',0,0)", "undefined");
13 shouldBe("ctx.strokeText('moo',0,0,0)", "undefined");
14 shouldBe("ctx.strokeText('moo',0,0,0,0)", "undefined");