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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.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 SVGFEComp ositeElement");
2
3 var feCompositeElement = document.createElementNS("http://www.w3.org/2000/svg", "feComposite");
4 feCompositeElement.setAttribute("operator", "over");
5
6 debug("");
7 debug("Check initial 'operator' value");
8 shouldBeEqualToString("feCompositeElement.operator.toString()", "[object SVGAnim atedEnumeration]");
9 shouldBeEqualToString("typeof(feCompositeElement.operator.baseVal)", "number");
10 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_OVER");
11
12 debug("");
13 debug("Switch to 'in'");
14 shouldBe("feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMP OSITE_OPERATOR_IN", "SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_IN");
15 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_IN");
16 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "in");
17
18 debug("");
19 debug("Switch to 'out'");
20 shouldBe("feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMP OSITE_OPERATOR_OUT", "SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OUT");
21 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_OUT");
22 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "out");
23
24 debug("");
25 debug("Switch to 'atop'");
26 shouldBe("feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMP OSITE_OPERATOR_ATOP", "SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ATOP");
27 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_ATOP");
28 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "atop");
29
30 debug("");
31 debug("Switch to 'xor'");
32 shouldBe("feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMP OSITE_OPERATOR_XOR", "SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_XOR");
33 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_XOR");
34 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "xor");
35
36 debug("");
37 debug("Switch to 'arithmetic'");
38 shouldBe("feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMP OSITE_OPERATOR_ARITHMETIC", "SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ARIT HMETIC");
39 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_ARITHMETIC");
40 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "arithmetic ");
41
42 debug("");
43 debug("Try setting invalid values");
44 shouldThrow("feCompositeElement.operator.baseVal = 7");
45 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_ARITHMETIC");
46 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "arithmetic ");
47
48 shouldThrow("feCompositeElement.operator.baseVal = -1");
49 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_ARITHMETIC");
50 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "arithmetic ");
51
52 shouldThrow("feCompositeElement.operator.baseVal = 0");
53 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_ARITHMETIC");
54 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "arithmetic ");
55
56 debug("");
57 debug("Switch to 'over'");
58 shouldBe("feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMP OSITE_OPERATOR_OVER", "SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER");
59 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_OVER");
60 shouldBeEqualToString("feCompositeElement.getAttribute('operator')", "over");
61
62 debug("");
63 debug("Switch to 'lighter'");
64 shouldBeUndefined("SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_LIGHTER");
65 feCompositeElement.setAttribute("operator", "lighter");
66 shouldBe("feCompositeElement.operator.baseVal", "SVGFECompositeElement.SVG_FECOM POSITE_OPERATOR_UNKNOWN");
67
68 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698