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

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

Issue 2416163002: 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 unified diff | Download patch
OLDNEW
(Empty)
1 description("This test checks the use of SVGAnimatedEnumeration within SVGFEMorp hologyElement");
2
3 var feMorphologyElement = document.createElementNS("http://www.w3.org/2000/svg", "feMorphology");
4 feMorphologyElement.setAttribute("operator", "erode");
5
6 debug("");
7 debug("Check initial 'operator' value");
8 shouldBeEqualToString("feMorphologyElement.operator.toString()", "[object SVGAni matedEnumeration]");
9 shouldBeEqualToString("typeof(feMorphologyElement.operator.baseVal)", "number");
10 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR PHOLOGY_OPERATOR_ERODE");
11
12 debug("");
13 debug("Switch to 'dilate'");
14 shouldBe("feMorphologyElement.operator.baseVal = SVGFEMorphologyElement.SVG_MORP HOLOGY_OPERATOR_DILATE", "SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_DILATE" );
15 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR PHOLOGY_OPERATOR_DILATE");
16 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "dilate");
17
18 debug("");
19 debug("Try setting invalid values");
20 shouldThrow("feMorphologyElement.operator.baseVal = 4");
21 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR PHOLOGY_OPERATOR_DILATE");
22 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "dilate");
23
24 shouldThrow("feMorphologyElement.operator.baseVal = -1");
25 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR PHOLOGY_OPERATOR_DILATE");
26 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "dilate");
27
28 shouldThrow("feMorphologyElement.operator.baseVal = 0");
29 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR PHOLOGY_OPERATOR_DILATE");
30 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "dilate");
31
32 debug("");
33 debug("Switch to 'erode'");
34 shouldBe("feMorphologyElement.operator.baseVal = SVGFEMorphologyElement.SVG_MORP HOLOGY_OPERATOR_ERODE", "SVGFEMorphologyElement.SVG_MORPHOLOGY_OPERATOR_ERODE");
35 shouldBe("feMorphologyElement.operator.baseVal", "SVGFEMorphologyElement.SVG_MOR PHOLOGY_OPERATOR_ERODE");
36 shouldBeEqualToString("feMorphologyElement.getAttribute('operator')", "erode");
37
38 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698