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

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

Issue 284163002: Better arity checks for overloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return properly Created 6 years, 7 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-setShadow.js
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-overloads-setShadow.js b/LayoutTests/fast/canvas/script-tests/canvas-overloads-setShadow.js
index 93538b933362986e8806a6fdb49e610786c78169..503ec212b64e33fe2328ca5a15241cef23df7f5a 100644
--- a/LayoutTests/fast/canvas/script-tests/canvas-overloads-setShadow.js
+++ b/LayoutTests/fast/canvas/script-tests/canvas-overloads-setShadow.js
@@ -2,23 +2,17 @@ description("Test the behavior of CanvasRenderingContext2D.setShadow() when call
var ctx = document.createElement('canvas').getContext('2d');
-function ExpectedNotEnoughArgumentsMessage(num) {
- return "\"TypeError: Failed to execute 'setShadow' on 'CanvasRenderingContext2D': 3 arguments required, but only " + num + " present.\"";
-}
-
-var TypeError = '"TypeError: Failed to execute \'setShadow\' on \'CanvasRenderingContext2D\': No function was found that matched the signature provided."';
-
-shouldThrow("ctx.setShadow()", ExpectedNotEnoughArgumentsMessage(0));
-shouldThrow("ctx.setShadow(0)", ExpectedNotEnoughArgumentsMessage(1));
-shouldThrow("ctx.setShadow(0, 0)", ExpectedNotEnoughArgumentsMessage(2));
+shouldThrow("ctx.setShadow()");
+shouldThrow("ctx.setShadow(0)");
+shouldThrow("ctx.setShadow(0, 0)");
shouldBe("ctx.setShadow(0, 0, 0)", "undefined");
shouldBe("ctx.setShadow(0, 0, 0, 0)", "undefined");
shouldBe("ctx.setShadow(0, 0, 0, 0, 0)", "undefined");
-shouldThrow("ctx.setShadow(0, 0, 0, 0, 0, 0)", "TypeError");
+shouldThrow("ctx.setShadow(0, 0, 0, 0, 0, 0)");
shouldBe("ctx.setShadow(0, 0, 0, 0, 'red')", "undefined");
-shouldThrow("ctx.setShadow(0, 0, 0, 0, 'red', 0)", "TypeError");
+shouldThrow("ctx.setShadow(0, 0, 0, 0, 'red', 0)");
shouldBe("ctx.setShadow(0, 0, 0, 0, 'red', 0, 0)", "undefined");
-shouldThrow("ctx.setShadow(0, 0, 0, 0, 0, 0)", "TypeError");
+shouldThrow("ctx.setShadow(0, 0, 0, 0, 0, 0)");
shouldBe("ctx.setShadow(0, 0, 0, 0, 0, 0, 0)", "undefined");
shouldBe("ctx.setShadow(0, 0, 0, 0, 0, 0, 0, 0)", "undefined");
-shouldThrow("ctx.setShadow(0, 0, 0, 0, 0, 0, 0, 0, 0)", "TypeError");
+shouldThrow("ctx.setShadow(0, 0, 0, 0, 0, 0, 0, 0, 0)");

Powered by Google App Engine
This is Rietveld 408576698