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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGClipPathElement.js

Issue 2389803004: Convert LayoutTests/svg/dom/SVGAnimatedEnumeration*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: Align with review comments 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 unified diff | Download patch
OLDNEW
(Empty)
1 description("This test checks the use of SVGAnimatedEnumeration within SVGClipPa thElement");
2
3 var clipPathElement = document.createElementNS("http://www.w3.org/2000/svg", "cl ipPath");
4 clipPathElement.setAttribute("clipPathUnits", "userSpaceOnUse");
5
6 debug("");
7 debug("Check initial 'clipPathUnits' value");
8 shouldBeEqualToString("clipPathElement.clipPathUnits.toString()", "[object SVGAn imatedEnumeration]");
9 shouldBeEqualToString("typeof(clipPathElement.clipPathUnits.baseVal)", "number") ;
10 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US ERSPACEONUSE");
11
12 debug("");
13 debug("Switch to 'objectBoundingBox'");
14 shouldBe("clipPathElement.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_OBJ ECTBOUNDINGBOX", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
15 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB JECTBOUNDINGBOX");
16 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "objectBo undingBox");
17
18 debug("");
19 debug("Try setting invalid values");
20 shouldThrow("clipPathElement.clipPathUnits.baseVal = 3");
21 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB JECTBOUNDINGBOX");
22 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "objectBo undingBox");
23
24 shouldThrow("clipPathElement.clipPathUnits.baseVal = -1");
25 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB JECTBOUNDINGBOX");
26 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "objectBo undingBox");
27
28 shouldThrow("clipPathElement.clipPathUnits.baseVal = 0");
29 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB JECTBOUNDINGBOX");
30 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "objectBo undingBox");
31
32 debug("");
33 debug("Switch to 'userSpaceOnUse'");
34 shouldBe("clipPathElement.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USE RSPACEONUSE", "SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE");
35 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US ERSPACEONUSE");
36 shouldBeEqualToString("clipPathElement.getAttribute('clipPathUnits')", "userSpac eOnUse");
37
38 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698