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

Side by Side Diff: LayoutTests/svg/dom/script-tests/SVGLength.js

Issue 1234383003: Removing TreatNullAs=NullString from SVGAngle.valueAsString and SVGLength.valueAsString attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
1 description("This test checks the SVGLength API"); 1 description("This test checks the SVGLength API");
2 2
3 var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 3 var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
4 var length = svgElement.createSVGLength(); 4 var length = svgElement.createSVGLength();
5 5
6 debug(""); 6 debug("");
7 debug("Check initial length values"); 7 debug("Check initial length values");
8 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER"); 8 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER");
9 shouldBe("length.value", "0"); 9 shouldBe("length.value", "0");
10 shouldBe("length.valueInSpecifiedUnits", "0"); 10 shouldBe("length.valueInSpecifiedUnits", "0");
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 shouldBe("length.value", "2"); 76 shouldBe("length.value", "2");
77 shouldBe("length.valueInSpecifiedUnits", "2"); 77 shouldBe("length.valueInSpecifiedUnits", "2");
78 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX"); 78 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
79 79
80 shouldThrow("length.valueAsString = ',5 em'"); 80 shouldThrow("length.valueAsString = ',5 em'");
81 shouldBeEqualToString("length.valueAsString", "2px"); 81 shouldBeEqualToString("length.valueAsString", "2px");
82 shouldBe("length.value", "2"); 82 shouldBe("length.value", "2");
83 shouldBe("length.valueInSpecifiedUnits", "2"); 83 shouldBe("length.valueInSpecifiedUnits", "2");
84 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX"); 84 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
85 85
86 shouldThrow("length.valueAsString = null");
87 shouldBeEqualToString("length.valueAsString", "2px");
88 shouldBe("length.value", "2");
89 shouldBe("length.valueInSpecifiedUnits", "2");
90 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
91
86 debug(""); 92 debug("");
87 debug("Check setting invalid 'value' arguments"); 93 debug("Check setting invalid 'value' arguments");
88 shouldThrow("length.value = NaN"); 94 shouldThrow("length.value = NaN");
89 shouldThrow("length.value = Infinity"); 95 shouldThrow("length.value = Infinity");
90 shouldBe("length.value", "2"); 96 shouldBe("length.value", "2");
91 shouldBe("length.valueInSpecifiedUnits", "2"); 97 shouldBe("length.valueInSpecifiedUnits", "2");
92 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX"); 98 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
93 99
94 debug(""); 100 debug("");
95 debug("Check setting invalid 'valueInSpecifiedUnits' arguments"); 101 debug("Check setting invalid 'valueInSpecifiedUnits' arguments");
96 shouldThrow("length.valueInSpecifiedUnits = NaN"); 102 shouldThrow("length.valueInSpecifiedUnits = NaN");
97 shouldThrow("length.valueInSpecifiedUnits = Infinity"); 103 shouldThrow("length.valueInSpecifiedUnits = Infinity");
98 shouldBe("length.value", "2"); 104 shouldBe("length.value", "2");
99 shouldBe("length.valueInSpecifiedUnits", "2"); 105 shouldBe("length.valueInSpecifiedUnits", "2");
100 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX"); 106 shouldBe("length.unitType", "SVGLength.SVG_LENGTHTYPE_PX");
101 107
102 successfullyParsed = true; 108 successfullyParsed = true;
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/script-tests/SVGAngle.js ('k') | LayoutTests/svg/dom/svg-element-attribute-js-null.xhtml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698