OLD | NEW |
| (Empty) |
1 This test checks the SVGAngle API | |
2 | |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 | |
7 Check initial angle values | |
8 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
9 PASS angle.valueAsString is "0" | |
10 PASS angle.value is 0 | |
11 PASS angle.valueInSpecifiedUnits is 0 | |
12 | |
13 Check invalid arguments for 'convertToSpecifiedUnits' | |
14 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNKNOWN) threw excepti
on NotSupportedError: Failed to execute 'convertToSpecifiedUnits' on 'SVGAngle':
Cannot convert to unknown or invalid units (0).. | |
15 PASS angle.convertToSpecifiedUnits(-1) threw exception NotSupportedError: Failed
to execute 'convertToSpecifiedUnits' on 'SVGAngle': Cannot convert to unknown o
r invalid units (65535).. | |
16 PASS angle.convertToSpecifiedUnits(5) threw exception NotSupportedError: Failed
to execute 'convertToSpecifiedUnits' on 'SVGAngle': Cannot convert to unknown or
invalid units (5).. | |
17 PASS angle.convertToSpecifiedUnits('aString') threw exception NotSupportedError:
Failed to execute 'convertToSpecifiedUnits' on 'SVGAngle': Cannot convert to un
known or invalid units (0).. | |
18 PASS angle.convertToSpecifiedUnits(angle) threw exception NotSupportedError: Fai
led to execute 'convertToSpecifiedUnits' on 'SVGAngle': Cannot convert to unknow
n or invalid units (0).. | |
19 PASS angle.convertToSpecifiedUnits(svgElement) threw exception NotSupportedError
: Failed to execute 'convertToSpecifiedUnits' on 'SVGAngle': Cannot convert to u
nknown or invalid units (0).. | |
20 PASS angle.convertToSpecifiedUnits() threw exception TypeError: Failed to execut
e 'convertToSpecifiedUnits' on 'SVGAngle': 1 argument required, but only 0 prese
nt.. | |
21 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
22 | |
23 Check valid arguments for 'convertToSpecifiedUnits', that should only modify the
'valueAsString' | |
24 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_RAD) is undefined. | |
25 PASS angle.valueAsString is "0rad" | |
26 PASS angle.value is 0 | |
27 PASS angle.valueInSpecifiedUnits is 0 | |
28 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_RAD | |
29 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_GRAD) is undefined. | |
30 PASS angle.valueAsString is "0grad" | |
31 PASS angle.value is 0 | |
32 PASS angle.valueInSpecifiedUnits is 0 | |
33 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_GRAD | |
34 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) is undefined. | |
35 PASS angle.valueAsString is "0deg" | |
36 PASS angle.value is 0 | |
37 PASS angle.valueInSpecifiedUnits is 0 | |
38 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG | |
39 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNSPECIFIED) is undefi
ned. | |
40 PASS angle.valueAsString is "0" | |
41 PASS angle.value is 0 | |
42 PASS angle.valueInSpecifiedUnits is 0 | |
43 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
44 | |
45 Check invalid arguments for 'newValueSpecifiedUnits' | |
46 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNKNOWN, 50) threw exce
ption NotSupportedError: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle
': Cannot set value with unknown or invalid units (0).. | |
47 PASS angle.newValueSpecifiedUnits(-1, 50) threw exception NotSupportedError: Fai
led to execute 'newValueSpecifiedUnits' on 'SVGAngle': Cannot set value with unk
nown or invalid units (65535).. | |
48 PASS angle.newValueSpecifiedUnits(5, 50) threw exception NotSupportedError: Fail
ed to execute 'newValueSpecifiedUnits' on 'SVGAngle': Cannot set value with unkn
own or invalid units (5).. | |
49 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) threw exception Ty
peError: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': 2 arguments r
equired, but only 1 present.. | |
50 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 'aString') threw e
xception TypeError: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': Th
e provided float value is non-finite.. | |
51 PASS angle.value is 0 | |
52 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 0) is undefined. | |
53 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, angle) threw excep
tion TypeError: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': The pr
ovided float value is non-finite.. | |
54 PASS angle.value is 0 | |
55 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, svgElement) threw
exception TypeError: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': T
he provided float value is non-finite.. | |
56 PASS angle.value is 0 | |
57 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, NaN) threw excepti
on TypeError: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': The prov
ided float value is non-finite.. | |
58 PASS angle.value is 0 | |
59 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, Infinity) threw ex
ception TypeError: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': The
provided float value is non-finite.. | |
60 PASS angle.value is 0 | |
61 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) threw exception Ty
peError: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': 2 arguments r
equired, but only 1 present.. | |
62 PASS angle.newValueSpecifiedUnits('aString', 4) threw exception NotSupportedErro
r: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': Cannot set value wi
th unknown or invalid units (0).. | |
63 PASS angle.newValueSpecifiedUnits(angle, 4) threw exception NotSupportedError: F
ailed to execute 'newValueSpecifiedUnits' on 'SVGAngle': Cannot set value with u
nknown or invalid units (0).. | |
64 PASS angle.newValueSpecifiedUnits(svgElement, 4) threw exception NotSupportedErr
or: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': Cannot set value w
ith unknown or invalid units (0).. | |
65 PASS angle.newValueSpecifiedUnits('aString', 'aString') threw exception TypeErro
r: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': The provided float
value is non-finite.. | |
66 PASS angle.newValueSpecifiedUnits(angle, angle) threw exception TypeError: Faile
d to execute 'newValueSpecifiedUnits' on 'SVGAngle': The provided float value is
non-finite.. | |
67 PASS angle.newValueSpecifiedUnits(svgElement, svgElement) threw exception TypeEr
ror: Failed to execute 'newValueSpecifiedUnits' on 'SVGAngle': The provided floa
t value is non-finite.. | |
68 PASS angle.newValueSpecifiedUnits() threw exception TypeError: Failed to execute
'newValueSpecifiedUnits' on 'SVGAngle': 2 arguments required, but only 0 presen
t.. | |
69 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG | |
70 | |
71 Check valid arguments for 'newValueSpecifiedUnits', that should only modify the
'valueAsString' | |
72 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_RAD, parseFloat(Math.PI
.toFixed(5))) is undefined. | |
73 PASS angle.valueAsString is "3.14159rad" | |
74 PASS angle.value.toFixed(1) is "180.0" | |
75 PASS angle.valueInSpecifiedUnits.toFixed(5) is Math.PI.toFixed(5) | |
76 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_RAD | |
77 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_GRAD, 400) is undefined
. | |
78 PASS angle.valueAsString is "400grad" | |
79 PASS angle.value.toFixed(1) is "360.0" | |
80 PASS angle.valueInSpecifiedUnits is 400 | |
81 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_GRAD | |
82 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 360) is undefined. | |
83 PASS angle.valueAsString is "360deg" | |
84 PASS angle.value is 360 | |
85 PASS angle.valueInSpecifiedUnits is 360 | |
86 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG | |
87 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNSPECIFIED, 180) is un
defined. | |
88 PASS angle.valueAsString is "180" | |
89 PASS angle.value is 180 | |
90 PASS angle.valueInSpecifiedUnits is 180 | |
91 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
92 | |
93 Reset to initial angle state | |
94 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNSPECIFIED, 0) is unde
fined. | |
95 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
96 | |
97 Check setting invalid 'valueAsString' arguments | |
98 PASS angle.valueAsString = '10px' threw exception SyntaxError: Failed to set the
'valueAsString' property on 'SVGAngle': The value provided ('10px') is invalid.
. | |
99 PASS angle.valueAsString is "0" | |
100 PASS angle.value is 0 | |
101 PASS angle.valueInSpecifiedUnits is 0 | |
102 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
103 PASS angle.valueAsString = '10x' threw exception SyntaxError: Failed to set the
'valueAsString' property on 'SVGAngle': The value provided ('10x') is invalid.. | |
104 PASS angle.valueAsString is "0" | |
105 PASS angle.value is 0 | |
106 PASS angle.valueInSpecifiedUnits is 0 | |
107 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
108 PASS angle.valueAsString = '5graD' threw exception SyntaxError: Failed to set th
e 'valueAsString' property on 'SVGAngle': The value provided ('5graD') is invali
d.. | |
109 PASS angle.valueAsString is "0" | |
110 PASS angle.value is 0 | |
111 PASS angle.valueInSpecifiedUnits is 0 | |
112 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
113 PASS angle.valueAsString = '5Rad' threw exception SyntaxError: Failed to set the
'valueAsString' property on 'SVGAngle': The value provided ('5Rad') is invalid.
. | |
114 PASS angle.valueAsString is "0" | |
115 PASS angle.value is 0 | |
116 PASS angle.valueInSpecifiedUnits is 0 | |
117 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
118 PASS angle.valueAsString = ',5 rad' threw exception SyntaxError: Failed to set t
he 'valueAsString' property on 'SVGAngle': The value provided (',5 rad') is inva
lid.. | |
119 PASS angle.valueAsString is "0" | |
120 PASS angle.value is 0 | |
121 PASS angle.valueInSpecifiedUnits is 0 | |
122 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
123 PASS angle.valueAsString = null threw exception SyntaxError: Failed to set the '
valueAsString' property on 'SVGAngle': The value provided ('null') is invalid.. | |
124 PASS angle.valueAsString is "0" | |
125 PASS angle.value is 0 | |
126 PASS angle.valueInSpecifiedUnits is 0 | |
127 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
128 | |
129 Check setting invalid 'valueInSpecifiedUnits' arguments | |
130 PASS angle.valueInSpecifiedUnits = 'test' threw exception TypeError: Failed to s
et the 'valueInSpecifiedUnits' property on 'SVGAngle': The provided float value
is non-finite.. | |
131 PASS angle.value is 0 | |
132 PASS angle.valueInSpecifiedUnits is 0 | |
133 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
134 PASS angle.valueInSpecifiedUnits = 0 is 0 | |
135 PASS angle.valueInSpecifiedUnits = angle threw exception TypeError: Failed to se
t the 'valueInSpecifiedUnits' property on 'SVGAngle': The provided float value i
s non-finite.. | |
136 PASS angle.value is 0 | |
137 PASS angle.valueInSpecifiedUnits = NaN threw exception TypeError: Failed to set
the 'valueInSpecifiedUnits' property on 'SVGAngle': The provided float value is
non-finite.. | |
138 PASS angle.value is 0 | |
139 PASS angle.valueInSpecifiedUnits = Infinity threw exception TypeError: Failed to
set the 'valueInSpecifiedUnits' property on 'SVGAngle': The provided float valu
e is non-finite.. | |
140 PASS angle.value is 0 | |
141 PASS angle.valueInSpecifiedUnits is 0 | |
142 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
143 | |
144 Check setting invalid 'value' arguments | |
145 PASS angle.value = 0 is 0 | |
146 PASS angle.value = 'test' threw exception TypeError: Failed to set the 'value' p
roperty on 'SVGAngle': The provided float value is non-finite.. | |
147 PASS angle.value is 0 | |
148 PASS angle.valueInSpecifiedUnits is 0 | |
149 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
150 PASS angle.value = 0 is 0 | |
151 PASS angle.value = angle threw exception TypeError: Failed to set the 'value' pr
operty on 'SVGAngle': The provided float value is non-finite.. | |
152 PASS angle.value is 0 | |
153 PASS angle.value = NaN threw exception TypeError: Failed to set the 'value' prop
erty on 'SVGAngle': The provided float value is non-finite.. | |
154 PASS angle.value is 0 | |
155 PASS angle.value = Infinity threw exception TypeError: Failed to set the 'value'
property on 'SVGAngle': The provided float value is non-finite.. | |
156 PASS angle.value is 0 | |
157 PASS angle.valueInSpecifiedUnits is 0 | |
158 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED | |
159 | |
160 Reset to angle in degree units | |
161 PASS angle.newValueSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG, 0) is undefined. | |
162 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG | |
163 | |
164 Check setting valid 'value' arguments, assure that 'valueInSpecifiedUnits' and '
valueAsString' are synchronized | |
165 PASS angle.value = 50 is 50 | |
166 PASS angle.valueInSpecifiedUnits is 50 | |
167 PASS angle.valueAsString is "50deg" | |
168 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG | |
169 | |
170 Try modifiying the readonly 'unitType', needs to fail | |
171 PASS angle.unitType = SVGAngle.SVG_ANGLETTYE_RAD is undefined. | |
172 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG | |
173 | |
174 Check setting valid 'valueInSpecifiedUnits' arguments, assure that 'value' and '
valueAsString' are synchronized | |
175 PASS angle.valueInSpecifiedUnits = 100 is 100 | |
176 PASS angle.value is 100 | |
177 PASS angle.valueAsString is "100deg" | |
178 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG | |
179 | |
180 Check setting valid 'valueAsString' arguments, assure that 'value' and 'valueInS
pecifiedUnits' are synchronized | |
181 PASS angle.valueAsString = '200grad' is "200grad" | |
182 PASS angle.valueInSpecifiedUnits is 200 | |
183 PASS angle.value.toFixed(1) is "180.0" | |
184 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_GRAD | |
185 | |
186 Now convert the GRAD value into a RAD value, and assure that all properties have
been synchronized | |
187 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_RAD) is undefined. | |
188 PASS angle.value.toFixed(1) is "180.0" | |
189 PASS angle.valueInSpecifiedUnits.toFixed(5) is "3.14159" | |
190 PASS angle.valueAsString is "3.14159rad" | |
191 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_RAD | |
192 | |
193 Now try converting the RAD value into an unknown value, that should fail and thr
ow | |
194 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_UNKNOWN) threw excepti
on NotSupportedError: Failed to execute 'convertToSpecifiedUnits' on 'SVGAngle':
Cannot convert to unknown or invalid units (0).. | |
195 PASS angle.value.toFixed(1) is "180.0" | |
196 PASS angle.valueInSpecifiedUnits.toFixed(5) is "3.14159" | |
197 PASS angle.valueAsString is "3.14159rad" | |
198 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_RAD | |
199 | |
200 Now convert the RAD value into a DEG value, and assure that all properties have
been synchronized | |
201 PASS angle.convertToSpecifiedUnits(SVGAngle.SVG_ANGLETYPE_DEG) is undefined. | |
202 PASS angle.value.toFixed(1) is "180.0" | |
203 PASS angle.valueInSpecifiedUnits.toFixed(1) is "180.0" | |
204 PASS angle.valueAsString is "180deg" | |
205 PASS angle.unitType is SVGAngle.SVG_ANGLETYPE_DEG | |
206 PASS successfullyParsed is true | |
207 | |
208 TEST COMPLETE | |
209 | |
OLD | NEW |