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

Unified Diff: LayoutTests/svg/dom/script-tests/SVGAngle.js

Issue 930053002: Apply TypeChecking=Unrestricted to SVG{Number,Length,Transform,Angle} (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/svg/dom/script-tests/SVGAngle.js
diff --git a/LayoutTests/svg/dom/script-tests/SVGAngle.js b/LayoutTests/svg/dom/script-tests/SVGAngle.js
index 2ad104c0bad0cf894e49f96dce63a436ce332ade..295f87f51f7965dae440ee6abdcbe002487f5f5e 100644
--- a/LayoutTests/svg/dom/script-tests/SVGAngle.js
+++ b/LayoutTests/svg/dom/script-tests/SVGAngle.js
@@ -59,13 +59,17 @@ shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNKNOWN, 50)");
shouldThrow("angle.newValueSpecifiedUnits(-1, 50)");
shouldThrow("angle.newValueSpecifiedUnits(5, 50)");
shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG)");
-shouldBeUndefined("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 'aString')");
-shouldBe("angle.value", "NaN");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 'aString')");
+shouldBe("angle.value", "0");
shouldBeUndefined("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 0)");
-shouldBeUndefined("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, angle)");
-shouldBe("angle.value", "NaN");
-shouldBeUndefined("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, svgElement)");
-shouldBe("angle.value", "NaN");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, angle)");
+shouldBe("angle.value", "0");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, svgElement)");
+shouldBe("angle.value", "0");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, NaN)");
+shouldBe("angle.value", "0");
+shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, Infinity)");
+shouldBe("angle.value", "0");
shouldThrow("angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG)");
// All of the following unitType arguments convert to 0 (SVG_ANGLETYPE_UNKNOWN).
shouldThrow("angle.newValueSpecifiedUnits('aString', 4)");
@@ -143,29 +147,37 @@ shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
debug("");
debug("Check setting invalid 'valueInSpecifiedUnits' arguments");
-shouldBe("angle.valueInSpecifiedUnits = 'test'", "'test'");
-shouldBe("angle.value", "NaN");
-shouldBe("angle.valueInSpecifiedUnits", "NaN");
+shouldThrow("angle.valueInSpecifiedUnits = 'test'");
+shouldBe("angle.value", "0");
+shouldBe("angle.valueInSpecifiedUnits", "0");
shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
shouldBe("angle.valueInSpecifiedUnits = 0", "0");
-shouldBe("angle.valueInSpecifiedUnits = angle", "angle");
-shouldBe("angle.value", "NaN");
-shouldBe("angle.valueInSpecifiedUnits", "NaN");
+shouldThrow("angle.valueInSpecifiedUnits = angle");
+shouldBe("angle.value", "0");
+shouldThrow("angle.valueInSpecifiedUnits = NaN");
+shouldBe("angle.value", "0");
+shouldThrow("angle.valueInSpecifiedUnits = Infinity");
+shouldBe("angle.value", "0");
+shouldBe("angle.valueInSpecifiedUnits", "0");
shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
debug("");
debug("Check setting invalid 'value' arguments");
shouldBe("angle.value = 0", "0");
-shouldBe("angle.value = 'test'", "'test'");
-shouldBe("angle.value", "NaN");
-shouldBe("angle.valueInSpecifiedUnits", "NaN");
+shouldThrow("angle.value = 'test'");
+shouldBe("angle.value", "0");
+shouldBe("angle.valueInSpecifiedUnits", "0");
shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
shouldBe("angle.value = 0", "0");
-shouldBe("angle.value = angle", "angle");
-shouldBe("angle.value", "NaN");
-shouldBe("angle.valueInSpecifiedUnits", "NaN");
+shouldThrow("angle.value = angle");
+shouldBe("angle.value", "0");
+shouldThrow("angle.value = NaN");
+shouldBe("angle.value", "0");
+shouldThrow("angle.value = Infinity");
+shouldBe("angle.value", "0");
+shouldBe("angle.valueInSpecifiedUnits", "0");
shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
debug("");
« no previous file with comments | « LayoutTests/svg/dom/SVGTransform-expected.txt ('k') | LayoutTests/svg/dom/script-tests/SVGAnimatedNumber.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698