OLD | NEW |
1 description("This test checks the SVGAngle API"); | 1 description("This test checks the SVGAngle 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 angle = svgElement.createSVGAngle(); | 4 var angle = svgElement.createSVGAngle(); |
5 | 5 |
6 debug(""); | 6 debug(""); |
7 debug("Check initial angle values"); | 7 debug("Check initial angle values"); |
8 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); | 8 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); |
9 shouldBeEqualToString("angle.valueAsString", "0"); | 9 shouldBeEqualToString("angle.valueAsString", "0"); |
10 shouldBe("angle.value", "0"); | 10 shouldBe("angle.value", "0"); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 shouldBe("angle.value", "0"); | 138 shouldBe("angle.value", "0"); |
139 shouldBe("angle.valueInSpecifiedUnits", "0"); | 139 shouldBe("angle.valueInSpecifiedUnits", "0"); |
140 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); | 140 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); |
141 | 141 |
142 shouldThrow("angle.valueAsString = ',5 rad'"); | 142 shouldThrow("angle.valueAsString = ',5 rad'"); |
143 shouldBeEqualToString("angle.valueAsString", "0"); | 143 shouldBeEqualToString("angle.valueAsString", "0"); |
144 shouldBe("angle.value", "0"); | 144 shouldBe("angle.value", "0"); |
145 shouldBe("angle.valueInSpecifiedUnits", "0"); | 145 shouldBe("angle.valueInSpecifiedUnits", "0"); |
146 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); | 146 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); |
147 | 147 |
| 148 shouldThrow("angle.valueAsString = null"); |
| 149 shouldBeEqualToString("angle.valueAsString", "0"); |
| 150 shouldBe("angle.value", "0"); |
| 151 shouldBe("angle.valueInSpecifiedUnits", "0"); |
| 152 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); |
| 153 |
148 debug(""); | 154 debug(""); |
149 debug("Check setting invalid 'valueInSpecifiedUnits' arguments"); | 155 debug("Check setting invalid 'valueInSpecifiedUnits' arguments"); |
150 shouldThrow("angle.valueInSpecifiedUnits = 'test'"); | 156 shouldThrow("angle.valueInSpecifiedUnits = 'test'"); |
151 shouldBe("angle.value", "0"); | 157 shouldBe("angle.value", "0"); |
152 shouldBe("angle.valueInSpecifiedUnits", "0"); | 158 shouldBe("angle.valueInSpecifiedUnits", "0"); |
153 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); | 159 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); |
154 shouldBe("angle.valueInSpecifiedUnits = 0", "0"); | 160 shouldBe("angle.valueInSpecifiedUnits = 0", "0"); |
155 | 161 |
156 shouldThrow("angle.valueInSpecifiedUnits = angle"); | 162 shouldThrow("angle.valueInSpecifiedUnits = angle"); |
157 shouldBe("angle.value", "0"); | 163 shouldBe("angle.value", "0"); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 235 |
230 debug(""); | 236 debug(""); |
231 debug("Now convert the RAD value into a DEG value, and assure that all propertie
s have been synchronized"); | 237 debug("Now convert the RAD value into a DEG value, and assure that all propertie
s have been synchronized"); |
232 shouldBeUndefined("angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG)"); | 238 shouldBeUndefined("angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG)"); |
233 shouldBeEqualToString("angle.value.toFixed(1)", "180.0"); | 239 shouldBeEqualToString("angle.value.toFixed(1)", "180.0"); |
234 shouldBeEqualToString("angle.valueInSpecifiedUnits.toFixed(1)", "180.0"); | 240 shouldBeEqualToString("angle.valueInSpecifiedUnits.toFixed(1)", "180.0"); |
235 shouldBeEqualToString("angle.valueAsString", "180deg"); | 241 shouldBeEqualToString("angle.valueAsString", "180deg"); |
236 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_DEG"); | 242 shouldBe("angle.unitType", "SVGAngle.SVG_ANGLETYPE_DEG"); |
237 | 243 |
238 successfullyParsed = true; | 244 successfullyParsed = true; |
OLD | NEW |