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

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

Issue 24203002: Improve generated "Not enough arguments." TypeError exceptions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: NeedsRebaseline Created 7 years, 3 months 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js b/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js
index 1344e634df43ac036d8f762ff9ab83096c6e85c0..c6b78659b52c21841a2de725c1939593c6dac2d7 100644
--- a/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js
+++ b/LayoutTests/fast/canvas/script-tests/canvas-overloads-fillText.js
@@ -2,12 +2,15 @@ description("Test the behavior of CanvasRenderingContext2D.fillText() when calle
var ctx = document.createElement('canvas').getContext('2d');
-var NotEnoughArguments = "TypeError: Not enough arguments";
+function ExpectedNotEnoughArgumentsMessage(num) {
+ return "\"TypeError: Failed to execute 'fillText' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\"";
+}
+
var TypeError = "TypeError: Type error";
-shouldThrow("ctx.fillText()", "NotEnoughArguments");
-shouldThrow("ctx.fillText('moo')", "NotEnoughArguments");
-shouldThrow("ctx.fillText('moo',0)", "NotEnoughArguments");
+shouldThrow("ctx.fillText()", ExpectedNotEnoughArgumentsMessage(0));
+shouldThrow("ctx.fillText('moo')", ExpectedNotEnoughArgumentsMessage(1));
+shouldThrow("ctx.fillText('moo',0)", ExpectedNotEnoughArgumentsMessage(2));
shouldBe("ctx.fillText('moo',0,0)", "undefined");
shouldBe("ctx.fillText('moo',0,0,0)", "undefined");
shouldBe("ctx.fillText('moo',0,0,0,0)", "undefined");

Powered by Google App Engine
This is Rietveld 408576698