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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration.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 SVGAnimatedEnumeration API - utilizing the cli pPathUnits property of SVGClipPathElement");
2
3 var clipPathElement = document.createElementNS("http://www.w3.org/2000/svg", "cl ipPath");
4
5 debug("");
6 debug("Check initial clipPathUnits value");
7 shouldBeEqualToString("clipPathElement.clipPathUnits.toString()", "[object SVGAn imatedEnumeration]");
8 shouldBeEqualToString("typeof(clipPathElement.clipPathUnits.baseVal)", "number") ;
9 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US ERSPACEONUSE");
10
11 debug("");
12 debug("Check that enumerations are static, caching value in a local variable and modifying it, should have no effect");
13 var enumRef = clipPathElement.clipPathUnits.baseVal;
14 enumRef = SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
15 shouldBe("enumRef", "SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX");
16 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US ERSPACEONUSE");
17
18 debug("");
19 debug("Check assigning various valid and invalid values");
20 shouldThrow("clipPathElement.clipPathUnits.baseVal = 3");
21 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US ERSPACEONUSE");
22 shouldThrow("clipPathElement.clipPathUnits.baseVal = -1");
23 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US ERSPACEONUSE");
24
25 // ECMA-262, 9.7, "ToUint16"
26 shouldBeEqualToString("clipPathElement.clipPathUnits.baseVal = '1'", SVGUnitType s.SVG_UNIT_TYPE_USERSPACEONUSE.toString());
27 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US ERSPACEONUSE");
28
29 // ECMA-262, 9.7, "ToUint16"
30 shouldThrow("clipPathElement.clipPathUnits.baseVal = 'aString'");
31 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_US ERSPACEONUSE");
32
33 shouldBe("clipPathElement.clipPathUnits.baseVal = 2", "SVGUnitTypes.SVG_UNIT_TYP E_OBJECTBOUNDINGBOX");
34 shouldThrow("clipPathElement.clipPathUnits.baseVal = clipPathElement");
35 shouldBe("clipPathElement.clipPathUnits.baseVal", "SVGUnitTypes.SVG_UNIT_TYPE_OB JECTBOUNDINGBOX");
36
37 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698