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

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

Issue 2447633002: Convert LayoutTests/svg/dom/SVGAnimatedEnumeration*.html js-tests.js to testharness.js based tests. (Closed)
Patch Set: Created 4 years, 1 month 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 SVGTextCo ntentElement");
2
3 var textContentElement = document.createElementNS("http://www.w3.org/2000/svg", "text");
4 textContentElement.setAttribute("lengthAdjust", "spacing");
5
6 debug("");
7 debug("Check initial 'lengthAdjust' value");
8 shouldBeEqualToString("textContentElement.lengthAdjust.toString()", "[object SVG AnimatedEnumeration]");
9 shouldBeEqualToString("typeof(textContentElement.lengthAdjust.baseVal)", "number ");
10 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT HADJUST_SPACING");
11
12 debug("");
13 debug("Switch to 'spacingAndGlyphs'");
14 shouldBe("textContentElement.lengthAdjust.baseVal = SVGTextContentElement.LENGTH ADJUST_SPACINGANDGLYPHS", "SVGTextContentElement.LENGTHADJUST_SPACINGANDGLYPHS") ;
15 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT HADJUST_SPACINGANDGLYPHS");
16 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin gAndGlyphs");
17
18 debug("");
19 debug("Try setting invalid values");
20 shouldThrow("textContentElement.lengthAdjust.baseVal = 3");
21 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT HADJUST_SPACINGANDGLYPHS");
22 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin gAndGlyphs");
23
24 shouldThrow("textContentElement.lengthAdjust.baseVal = -1");
25 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT HADJUST_SPACINGANDGLYPHS");
26 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin gAndGlyphs");
27
28 shouldThrow("textContentElement.lengthAdjust.baseVal = 0");
29 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT HADJUST_SPACINGANDGLYPHS");
30 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin gAndGlyphs");
31
32 debug("");
33 debug("Switch to 'spacing'");
34 shouldBe("textContentElement.lengthAdjust.baseVal = SVGTextContentElement.LENGTH ADJUST_SPACING", "SVGTextContentElement.LENGTHADJUST_SPACING");
35 shouldBe("textContentElement.lengthAdjust.baseVal", "SVGTextContentElement.LENGT HADJUST_SPACING");
36 shouldBeEqualToString("textContentElement.getAttribute('lengthAdjust')", "spacin g");
37
38 successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698