summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js
blob: 6597e18ed6c5e0da93201c31d2bad9580c6bd2ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
description("Test the behavior of CanvasRenderingContext2D.fillText() when called with different numbers of arguments.");

var ctx = document.createElement('canvas').getContext('2d');

var NotEnoughArguments = "TypeError: Not enough arguments";
var TypeError = "TypeError: Type error";

shouldThrow("ctx.fillText()", "NotEnoughArguments");
shouldThrow("ctx.fillText('moo')", "NotEnoughArguments");
shouldThrow("ctx.fillText('moo',0)", "NotEnoughArguments");
shouldBe("ctx.fillText('moo',0,0)", "undefined");
shouldBe("ctx.fillText('moo',0,0,0)", "undefined");
shouldBe("ctx.fillText('moo',0,0,0,0)", "undefined");

var successfullyParsed = true;