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

Unified Diff: LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.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-setFillColor.js
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js b/LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js
index c841baa74fe3cdf70991e3fb51e7ebff86583185..ff5a1e7e2d0db14ddf2aae6e5235888137c1f023 100644
--- a/LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js
+++ b/LayoutTests/fast/canvas/script-tests/canvas-overloads-setFillColor.js
@@ -2,17 +2,11 @@ description("Test the behavior of CanvasRenderingContext2D.setFillColor() when c
var ctx = document.createElement('canvas').getContext('2d');
-function ExpectedNotEnoughArgumentsMessage(num) {
- return "\"TypeError: Failed to execute 'setFillColor' on 'CanvasRenderingContext2D': 1 argument required, but only " + num + " present.\"";
-}
-
-var TypeError = '"TypeError: Failed to execute \'setFillColor\' on \'CanvasRenderingContext2D\': No function was found that matched the signature provided."';
-
-shouldThrow("ctx.setFillColor()", ExpectedNotEnoughArgumentsMessage(0));
+shouldThrow("ctx.setFillColor()");
shouldBe("ctx.setFillColor('red')", "undefined");
shouldBe("ctx.setFillColor(0)", "undefined");
shouldBe("ctx.setFillColor(0, 0)", "undefined");
-shouldThrow("ctx.setFillColor(0, 0, 0)", "TypeError");
+shouldThrow("ctx.setFillColor(0, 0, 0)");
shouldBe("ctx.setFillColor(0, 0, 0, 0)", "undefined");
shouldBe("ctx.setFillColor(0, 0, 0, 0, 0)", "undefined");
-shouldThrow("ctx.setFillColor(0, 0, 0, 0, 0, 0)", "TypeError");
+shouldThrow("ctx.setFillColor(0, 0, 0, 0, 0, 0)");

Powered by Google App Engine
This is Rietveld 408576698