Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js

Issue 36843003: Improve remaining TypeErrors in bindings code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: vibration. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description("Test the behavior of CanvasRenderingContext2D.fillText() when calle d with different numbers of arguments."); 1 description("Test the behavior of CanvasRenderingContext2D.fillText() when calle d 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 function ExpectedNotEnoughArgumentsMessage(num) {
6 return "\"TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext 2D': 3 arguments required, but only " + num + " present.\""; 6 return "\"TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext 2D': 3 arguments required, but only " + num + " present.\"";
7 } 7 }
8 8
9 var TypeError = "TypeError: Type error";
10
11 shouldThrow("ctx.fillText()", ExpectedNotEnoughArgumentsMessage(0)); 9 shouldThrow("ctx.fillText()", ExpectedNotEnoughArgumentsMessage(0));
12 shouldThrow("ctx.fillText('moo')", ExpectedNotEnoughArgumentsMessage(1)); 10 shouldThrow("ctx.fillText('moo')", ExpectedNotEnoughArgumentsMessage(1));
13 shouldThrow("ctx.fillText('moo',0)", ExpectedNotEnoughArgumentsMessage(2)); 11 shouldThrow("ctx.fillText('moo',0)", ExpectedNotEnoughArgumentsMessage(2));
14 shouldBe("ctx.fillText('moo',0,0)", "undefined"); 12 shouldBe("ctx.fillText('moo',0,0)", "undefined");
15 shouldBe("ctx.fillText('moo',0,0,0)", "undefined"); 13 shouldBe("ctx.fillText('moo',0,0,0)", "undefined");
16 shouldBe("ctx.fillText('moo',0,0,0,0)", "undefined"); 14 shouldBe("ctx.fillText('moo',0,0,0,0)", "undefined");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698