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

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

Issue 2447633002: Convert LayoutTests/svg/dom/SVGAnimatedEnumeration*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: Created 4 years, 2 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/SVGAnimatedEnumeration-SVGMarkerElement.js
diff --git a/third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js b/third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js
deleted file mode 100644
index d58f89e658ae60e8a8e1720305e8498b9e845757..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGMarkerElement.js
+++ /dev/null
@@ -1,117 +0,0 @@
-description("This test checks the use of SVGAnimatedEnumeration within SVGMarkerElement");
-
-var markerElement = document.createElementNS("http://www.w3.org/2000/svg", "marker");
-markerElement.setAttribute("markerUnits", "userSpaceOnUse");
-markerElement.setAttribute("orient", "auto");
-
-var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
-
-// markerUnits
-debug("");
-debug("Check initial 'markerUnits' value");
-shouldBeEqualToString("markerElement.markerUnits.toString()", "[object SVGAnimatedEnumeration]");
-shouldBeEqualToString("typeof(markerElement.markerUnits.baseVal)", "number");
-shouldBe("markerElement.markerUnits.baseVal", "SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE");
-
-debug("");
-debug("Switch to 'strokeWidth'");
-shouldBe("markerElement.markerUnits.baseVal = SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH", "SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH");
-shouldBe("markerElement.markerUnits.baseVal", "SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH");
-shouldBeEqualToString("markerElement.getAttribute('markerUnits')", "strokeWidth");
-
-debug("");
-debug("Try setting invalid values");
-shouldThrow("markerElement.markerUnits.baseVal = 3");
-shouldBe("markerElement.markerUnits.baseVal", "SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH");
-shouldBeEqualToString("markerElement.getAttribute('markerUnits')", "strokeWidth");
-
-shouldThrow("markerElement.markerUnits.baseVal = -1");
-shouldBe("markerElement.markerUnits.baseVal", "SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH");
-shouldBeEqualToString("markerElement.getAttribute('markerUnits')", "strokeWidth");
-
-shouldThrow("markerElement.markerUnits.baseVal = 0");
-shouldBe("markerElement.markerUnits.baseVal", "SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH");
-shouldBeEqualToString("markerElement.getAttribute('markerUnits')", "strokeWidth");
-
-debug("");
-debug("Switch to 'userSpaceOnUse'");
-shouldBe("markerElement.markerUnits.baseVal = SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE", "SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE");
-shouldBe("markerElement.markerUnits.baseVal", "SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE");
-shouldBeEqualToString("markerElement.getAttribute('markerUnits')", "userSpaceOnUse");
-
-// orientType
-debug("");
-debug("Check initial 'orient' value");
-shouldBeEqualToString("markerElement.orientType.toString()", "[object SVGAnimatedEnumeration]");
-shouldBeEqualToString("typeof(markerElement.orientType.baseVal)", "number");
-shouldBe("markerElement.orientAngle.baseVal.value", "0");
-shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO");
-
-debug("");
-debug("Switch to 'Pi/2 rad' value - via setOrientToAngle()");
-shouldBeUndefined("anglePiHalfRad = svgElement.createSVGAngle(); anglePiHalfRad.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_RAD, (Math.PI / 2).toFixed(2))");
-shouldBeUndefined("markerElement.setOrientToAngle(anglePiHalfRad)");
-shouldBeEqualToString("markerElement.orientAngle.baseVal.value.toFixed(1)", "90.0");
-shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_RAD");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE");
-shouldBeEqualToString("markerElement.getAttribute('orient')", (Math.PI / 2).toFixed(2) + "rad");
-
-debug("");
-debug("Switch to 'auto' value - via setOrientToAuto()");
-shouldBeUndefined("markerElement.setOrientToAuto()");
-shouldBe("markerElement.orientAngle.baseVal.value", "0");
-shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO");
-shouldBeEqualToString("markerElement.getAttribute('orient')", "auto");
-
-debug("");
-debug("Switch to '20deg' value - via setOrientToAngle()");
-shouldBeUndefined("angle20deg = svgElement.createSVGAngle(); angle20deg.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 20)");
-shouldBeUndefined("markerElement.setOrientToAngle(angle20deg)");
-shouldBe("markerElement.orientAngle.baseVal.value", "20");
-shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_DEG");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE");
-shouldBeEqualToString("markerElement.getAttribute('orient')", "20deg");
-
-debug("");
-debug("Switch to '10deg' value");
-shouldBe("markerElement.orientAngle.baseVal.value = 10", "10");
-shouldBe("markerElement.orientAngle.baseVal.value", "10");
-shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_DEG");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE");
-shouldBeEqualToString("markerElement.getAttribute('orient')", "10deg");
-
-debug("");
-debug("Switch to 'auto' value - by modifying orientType");
-shouldBe("markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO");
-shouldBe("markerElement.orientAngle.baseVal.value", "0");
-shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO");
-shouldBeEqualToString("markerElement.getAttribute('orient')", "auto");
-
-markerElement.setAttribute('orient', '10deg');
-
-debug("");
-debug("Try setting invalid values");
-shouldThrow("markerElement.orientType.baseVal = 3");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE");
-shouldBeEqualToString("markerElement.getAttribute('orient')", "10deg");
-
-shouldThrow("markerElement.orientType.baseVal = -1");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE");
-shouldBeEqualToString("markerElement.getAttribute('orient')", "10deg");
-
-shouldThrow("markerElement.orientType.baseVal = 0");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE");
-shouldBeEqualToString("markerElement.getAttribute('orient')", "10deg");
-
-debug("");
-debug("Switch back to 'auto' value");
-shouldBe("markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO");
-shouldBe("markerElement.orientAngle.baseVal.value", "0");
-shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED");
-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO");
-shouldBeEqualToString("markerElement.getAttribute('orient')", "auto");
-
-successfullyParsed = true;

Powered by Google App Engine
This is Rietveld 408576698