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

Unified Diff: third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGLength.js

Issue 2271223002: Convert LayoutTests/svg/dom/SVGLength*.html js-tests.js tests to testharness.js based tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved length to local Created 4 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: third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGLength.js
diff --git a/third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGLength.js b/third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGLength.js
deleted file mode 100644
index 01d8279cd827a3920f0ba3409f0f0077cb5f6d5a..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGLength.js
+++ /dev/null
@@ -1,110 +0,0 @@
-description("This test checks the SVGLength API");
-
-var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
-var length = svgElement.createSVGLength();
-
-debug("");
-debug("Check initial length values");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
-shouldBe("length.value", "0");
-shouldBe("length.valueInSpecifiedUnits", "0");
-shouldBeEqualToString("length.valueAsString", "0");
-
-debug("");
-debug("Set value to be 2px");
-length.valueAsString = "2px";
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-shouldBe("length.value", "2");
-shouldBe("length.valueInSpecifiedUnits", "2");
-shouldBeEqualToString("length.valueAsString", "2px");
-
-debug("");
-debug("Check invalid arguments for 'convertToSpecifiedUnits'");
-shouldThrow("length.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_UNKNOWN)");
-shouldThrow("length.convertToSpecifiedUnits(-1)");
-shouldThrow("length.convertToSpecifiedUnits(11)");
-shouldThrow("length.convertToSpecifiedUnits('aString')");
-shouldThrow("length.convertToSpecifiedUnits(length)");
-shouldThrow("length.convertToSpecifiedUnits(svgElement)");
-shouldThrow("length.convertToSpecifiedUnits()");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-shouldBe("length.value", "2");
-shouldBe("length.valueInSpecifiedUnits", "2");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-
-debug("");
-debug("Check invalid arguments for 'newValueSpecifiedUnits'");
-shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_UNKNOWN, 4)");
-shouldThrow("length.newValueSpecifiedUnits(-1, 4)");
-shouldThrow("length.newValueSpecifiedUnits(11, 4)");
-// ECMA-262, 9.3, "ToNumber"
-shouldBeUndefined("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0)");
-shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 'aString')");
-shouldBe("length.value", "0");
-shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, length)");
-shouldBe("length.value", "0");
-shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, svgElement)");
-shouldBe("length.value", "0");
-shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, NaN)");
-shouldBe("length.value", "0");
-shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, Infinity)");
-shouldBe("length.value", "0");
-shouldThrow("length.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX)");
-// Reset to original value above.
-length.valueAsString = "2px";
-shouldThrow("length.newValueSpecifiedUnits('aString', 4)");
-shouldThrow("length.newValueSpecifiedUnits(length, 4)");
-shouldThrow("length.newValueSpecifiedUnits(svgElement, 4)");
-shouldThrow("length.newValueSpecifiedUnits('aString', 'aString')");
-shouldThrow("length.newValueSpecifiedUnits(length, length)");
-shouldThrow("length.newValueSpecifiedUnits(svgElement, svgElement)");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-shouldBe("length.value", "2");
-shouldBe("length.valueInSpecifiedUnits", "2");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-
-debug("");
-debug("Check setting invalid 'valueAsString' arguments");
-shouldThrow("length.valueAsString = '10deg'");
-shouldBeEqualToString("length.valueAsString", "2px");
-shouldBe("length.value", "2");
-shouldBe("length.valueInSpecifiedUnits", "2");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-
-shouldNotThrow("length.valueAsString = '1pX'");
-shouldBeEqualToString("length.valueAsString", "1px");
-shouldBe("length.value", "1");
-shouldBe("length.valueInSpecifiedUnits", "1");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-
-length.valueAsString = "2px"; // reset to 2px
-
-shouldThrow("length.valueAsString = ',5 em'");
-shouldBeEqualToString("length.valueAsString", "2px");
-shouldBe("length.value", "2");
-shouldBe("length.valueInSpecifiedUnits", "2");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-
-shouldThrow("length.valueAsString = null");
-shouldBeEqualToString("length.valueAsString", "2px");
-shouldBe("length.value", "2");
-shouldBe("length.valueInSpecifiedUnits", "2");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-
-debug("");
-debug("Check setting invalid 'value' arguments");
-shouldThrow("length.value = NaN");
-shouldThrow("length.value = Infinity");
-shouldBe("length.value", "2");
-shouldBe("length.valueInSpecifiedUnits", "2");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-
-debug("");
-debug("Check setting invalid 'valueInSpecifiedUnits' arguments");
-shouldThrow("length.valueInSpecifiedUnits = NaN");
-shouldThrow("length.valueInSpecifiedUnits = Infinity");
-shouldBe("length.value", "2");
-shouldBe("length.valueInSpecifiedUnits", "2");
-shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
-
-successfullyParsed = true;

Powered by Google App Engine
This is Rietveld 408576698