OLD | NEW |
1 | |
2 /* | 1 /* |
3 Copyright © 2001-2004 World Wide Web Consortium, | 2 Copyright © 2001-2004 World Wide Web Consortium, |
4 (Massachusetts Institute of Technology, European Research Consortium | 3 (Massachusetts Institute of Technology, European Research Consortium |
5 for Informatics and Mathematics, Keio University). All | 4 for Informatics and Mathematics, Keio University). All |
6 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the | 5 Rights Reserved. This work is distributed under the W3C® Software License [1] i
n the |
7 hope that it will be useful, but WITHOUT ANY WARRANTY; without even | 6 hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
8 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 7 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
9 | 8 |
10 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 | 9 [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 |
11 */ | 10 */ |
12 | 11 |
13 | |
14 // expose test function names | 12 // expose test function names |
15 function exposeTestFunctionNames() | 13 function exposeTestFunctionNames() |
16 { | 14 { |
17 return ['XPathResult_TYPE_ERR']; | 15 return ['XPathResult_TYPE_ERR']; |
18 } | 16 } |
19 | 17 |
20 var docsLoaded = -1000000; | 18 var docsLoaded = -1000000; |
21 var builder = null; | 19 var builder = null; |
22 | 20 |
23 // | 21 // |
24 // This function is called by the testing framework before | 22 // This function is called by the testing framework before |
25 // running the test suite. | 23 // running the test suite. |
26 // | 24 // |
27 // If there are no configuration exceptions, asynchronous | 25 // If there are no configuration exceptions, asynchronous |
28 // document loading is started. Otherwise, the status | 26 // document loading is started. Otherwise, the status |
29 // is set to complete and the exception is immediately | 27 // is set to complete and the exception is immediately |
30 // raised when entering the body of the test. | 28 // raised when entering the body of the test. |
31 // | 29 // |
32 function setUpPage() { | 30 function setUpPage() { |
33 setUpPageStatus = 'running'; | 31 setUpPageStatus = 'running'; |
34 try { | 32 try { |
35 // | 33 // |
36 // creates test document builder, may throw exception | 34 // creates test document builder, may throw exception |
37 // | 35 // |
38 builder = createConfiguredBuilder(); | 36 builder = createConfiguredBuilder(); |
39 | 37 |
40 docsLoaded = 0; | 38 docsLoaded = 0; |
41 | 39 |
42 var docRef = null; | 40 var docRef = null; |
43 if (typeof(this.doc) != 'undefined') { | 41 if (typeof(this.doc) != 'undefined') { |
44 docRef = this.doc; | 42 docRef = this.doc; |
45 } | 43 } |
46 docsLoaded += preload(docRef, "doc", "staff"); | 44 docsLoaded += preload(docRef, "doc", "staff"); |
47 | 45 |
48 if (docsLoaded == 1) { | 46 if (docsLoaded == 1) { |
49 setUpPageStatus = 'complete'; | 47 setUpPageStatus = 'complete'; |
50 } | 48 } |
51 } catch(ex) { | 49 } catch(ex) { |
52 » catchInitializationError(builder, ex); | 50 catchInitializationError(builder, ex); |
53 setUpPageStatus = 'complete'; | 51 setUpPageStatus = 'complete'; |
54 } | 52 } |
55 } | 53 } |
56 | 54 |
57 | |
58 | |
59 // | 55 // |
60 // This method is called on the completion of | 56 // This method is called on the completion of |
61 // each asychronous load started in setUpTests. | 57 // each asychronous load started in setUpTests. |
62 // | 58 // |
63 // When every synchronous loaded document has completed, | 59 // When every synchronous loaded document has completed, |
64 // the page status is changed which allows the | 60 // the page status is changed which allows the |
65 // body of the test to be executed. | 61 // body of the test to be executed. |
66 function loadComplete() { | 62 function loadComplete() { |
67 if (++docsLoaded == 1) { | 63 if (++docsLoaded == 1) { |
68 setUpPageStatus = 'complete'; | 64 setUpPageStatus = 'complete'; |
69 } | 65 } |
70 } | 66 } |
71 | 67 |
72 | |
73 /** | 68 /** |
74 * | 69 * |
75 Create an XPathResult for the expression /staff/employee | 70 Create an XPathResult for the expression /staff/employee |
76 for each type of XPathResultType, checking that TYPE_ERR | 71 for each type of XPathResultType, checking that TYPE_ERR |
77 is thrown when inappropriate properties and methods are accessed. | 72 is thrown when inappropriate properties and methods are accessed. |
78 | 73 |
79 * @author Bob Clary | 74 * @author Bob Clary |
80 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#TYPE_ERR | 75 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#TYPE_ERR |
81 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathExcept
ion | 76 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathExcept
ion |
82 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult | 77 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult |
83 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
Type | 78 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
Type |
84 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathEvalua
tor-createNSResolver | 79 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathEvalua
tor-createNSResolver |
85 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
-resultType | 80 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
-resultType |
86 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
-booleanValue | 81 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
-booleanValue |
87 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
-numberValue | 82 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
-numberValue |
88 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
-singleNodeValue | 83 * @see http://www.w3.org/TR/2003/CR-DOM-Level-3-XPath-20030331/xpath#XPathResult
-singleNodeValue |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 nodeTypeList[1] = 1; | 121 nodeTypeList[1] = 1; |
127 nodeTypeList[2] = 2; | 122 nodeTypeList[2] = 2; |
128 nodeTypeList[3] = 3; | 123 nodeTypeList[3] = 3; |
129 nodeTypeList[4] = 4; | 124 nodeTypeList[4] = 4; |
130 nodeTypeList[5] = 5; | 125 nodeTypeList[5] = 5; |
131 nodeTypeList[6] = 6; | 126 nodeTypeList[6] = 6; |
132 nodeTypeList[7] = 7; | 127 nodeTypeList[7] = 7; |
133 nodeTypeList[8] = 8; | 128 nodeTypeList[8] = 8; |
134 nodeTypeList[9] = 9; | 129 nodeTypeList[9] = 9; |
135 | 130 |
136 | |
137 var docRef = null; | 131 var docRef = null; |
138 if (typeof(this.doc) != 'undefined') { | 132 if (typeof(this.doc) != 'undefined') { |
139 docRef = this.doc; | 133 docRef = this.doc; |
140 } | 134 } |
141 doc = load(docRef, "doc", "staff"); | 135 doc = load(docRef, "doc", "staff"); |
142 evaluator = createXPathEvaluator(doc); | 136 evaluator = createXPathEvaluator(doc); |
143 resolver = evaluator.createNSResolver(doc); | 137 resolver = evaluator.createNSResolver(doc); |
144 contextNode = doc; | 138 contextNode = doc; |
145 for(var indexN65778 = 0;indexN65778 < nodeTypeList.length; indexN65778++) { | 139 for(var indexN65778 = 0;indexN65778 < nodeTypeList.length; indexN65778++) { |
146 inNodeType = nodeTypeList[indexN65778]; | 140 inNodeType = nodeTypeList[indexN65778]; |
147 outresult = evaluator.evaluate(expression,contextNode,resolver,inNodeType,
inresult); | 141 outresult = evaluator.evaluate(expression,contextNode,resolver,inNodeType,
inresult); |
148 outNodeType = outresult.resultType; | 142 outNodeType = outresult.resultType; |
149 | 143 |
150 | 144 if( |
151 » if( | 145 (outNodeType == NUMBER_TYPE) |
152 » (outNodeType == NUMBER_TYPE) | 146 ) { |
153 » ) { | 147 |
154 » | 148 { |
155 » { | 149 success = false; |
156 » » success = false; | 150 try { |
157 » » try { | 151 booleanValue = outresult.booleanValue; |
158 booleanValue = outresult.booleanValue; | 152 |
159 | 153 } |
160 } | 154 catch(ex) { |
161 » » catch(ex) { | 155 success = ex.name == 'TypeError'; |
162 success = ex.name == 'TypeError'; | 156 } |
163 » » } | 157 assertTrue("number_booleanValue_TYPE_ERR",success); |
164 » » assertTrue("number_booleanValue_TYPE_ERR",success); | 158 } |
165 » } | 159 |
166 | 160 { |
167 » { | 161 success = false; |
168 » » success = false; | 162 try { |
169 » » try { | |
170 nodeValue = outresult.singleNodeValue; | 163 nodeValue = outresult.singleNodeValue; |
171 | 164 |
172 } | 165 } |
173 » » catch(ex) { | 166 catch(ex) { |
174 success = ex.name == 'TypeError'; | 167 success = ex.name == 'TypeError'; |
175 » » } | 168 } |
176 » » assertTrue("number_singleNodeValue_TYPE_ERR",success); | 169 assertTrue("number_singleNodeValue_TYPE_ERR",success); |
177 » } | 170 } |
178 | 171 |
179 » { | 172 { |
180 » » success = false; | 173 success = false; |
181 » » try { | 174 try { |
182 intValue = outresult.snapshotLength; | 175 intValue = outresult.snapshotLength; |
183 | 176 |
184 } | 177 } |
185 » » catch(ex) { | 178 catch(ex) { |
186 success = ex.name == 'TypeError'; | 179 success = ex.name == 'TypeError'; |
187 » » } | 180 } |
188 » » assertTrue("number_snapshotLength_TYPE_ERR",success); | 181 assertTrue("number_snapshotLength_TYPE_ERR",success); |
189 » } | 182 } |
190 | 183 |
191 » { | 184 { |
192 » » success = false; | 185 success = false; |
193 » » try { | 186 try { |
194 stringValue = outresult.stringValue; | 187 stringValue = outresult.stringValue; |
195 | 188 |
196 } | 189 } |
197 » » catch(ex) { | 190 catch(ex) { |
198 success = ex.name == 'TypeError'; | 191 success = ex.name == 'TypeError'; |
199 » » } | 192 } |
200 » » assertTrue("number_stringValue_TYPE_ERR",success); | 193 assertTrue("number_stringValue_TYPE_ERR",success); |
201 » } | 194 } |
202 | 195 |
203 » { | 196 { |
204 » » success = false; | 197 success = false; |
205 » » try { | 198 try { |
206 nodeValue = outresult.iterateNext(); | 199 nodeValue = outresult.iterateNext(); |
207 } | 200 } |
208 » » catch(ex) { | 201 catch(ex) { |
209 success = ex.name == 'TypeError'; | 202 success = ex.name == 'TypeError'; |
210 » » } | 203 } |
211 » » assertTrue("number_iterateNext_TYPE_ERR",success); | 204 assertTrue("number_iterateNext_TYPE_ERR",success); |
212 » } | 205 } |
213 | 206 |
214 » { | 207 { |
215 » » success = false; | 208 success = false; |
216 » » try { | 209 try { |
217 nodeValue = outresult.snapshotItem(0); | 210 nodeValue = outresult.snapshotItem(0); |
218 } | 211 } |
219 » » catch(ex) { | 212 catch(ex) { |
220 success = ex.name == 'TypeError'; | 213 success = ex.name == 'TypeError'; |
221 » » } | 214 } |
222 » » assertTrue("number_snapshotItem_TYPE_ERR",success); | 215 assertTrue("number_snapshotItem_TYPE_ERR",success); |
223 » } | 216 } |
224 | 217 |
225 » } | 218 } |
226 » | 219 |
227 » if( | 220 if( |
228 » (outNodeType == STRING_TYPE) | 221 (outNodeType == STRING_TYPE) |
229 » ) { | 222 ) { |
230 » | 223 |
231 » { | 224 { |
232 » » success = false; | 225 success = false; |
233 » » try { | 226 try { |
234 booleanValue = outresult.booleanValue; | 227 booleanValue = outresult.booleanValue; |
235 | 228 |
236 } | 229 } |
237 » » catch(ex) { | 230 catch(ex) { |
238 success = ex.name == 'TypeError'; | 231 success = ex.name == 'TypeError'; |
239 » » } | 232 } |
240 » » assertTrue("string_booleanValue_TYPE_ERR",success); | 233 assertTrue("string_booleanValue_TYPE_ERR",success); |
241 » } | 234 } |
242 | 235 |
243 » { | 236 { |
244 » » success = false; | 237 success = false; |
245 » » try { | 238 try { |
246 doubleValue = outresult.numberValue; | 239 doubleValue = outresult.numberValue; |
247 | 240 |
248 } | 241 } |
249 » » catch(ex) { | 242 catch(ex) { |
250 success = ex.name == 'TypeError'; | 243 success = ex.name == 'TypeError'; |
251 » » } | 244 } |
252 » » assertTrue("string_numberValue_TYPE_ERR",success); | 245 assertTrue("string_numberValue_TYPE_ERR",success); |
253 » } | 246 } |
254 | 247 |
255 » { | 248 { |
256 » » success = false; | 249 success = false; |
257 » » try { | 250 try { |
258 nodeValue = outresult.singleNodeValue; | 251 nodeValue = outresult.singleNodeValue; |
259 | 252 |
260 } | 253 } |
261 » » catch(ex) { | 254 catch(ex) { |
262 success = ex.name == 'TypeError'; | 255 success = ex.name == 'TypeError'; |
263 » » } | 256 } |
264 » » assertTrue("string_singleNodeValue_TYPE_ERR",success); | 257 assertTrue("string_singleNodeValue_TYPE_ERR",success); |
265 » } | 258 } |
266 | 259 |
267 » { | 260 { |
268 » » success = false; | 261 success = false; |
269 » » try { | 262 try { |
270 intValue = outresult.snapshotLength; | 263 intValue = outresult.snapshotLength; |
271 | 264 |
272 } | 265 } |
273 » » catch(ex) { | 266 catch(ex) { |
274 success = ex.name == 'TypeError'; | 267 success = ex.name == 'TypeError'; |
275 » » } | 268 } |
276 » » assertTrue("string_snapshotLength_TYPE_ERR",success); | 269 assertTrue("string_snapshotLength_TYPE_ERR",success); |
277 » } | 270 } |
278 | 271 |
279 » { | 272 { |
280 » » success = false; | 273 success = false; |
281 » » try { | 274 try { |
282 nodeValue = outresult.iterateNext(); | 275 nodeValue = outresult.iterateNext(); |
283 } | 276 } |
284 » » catch(ex) { | 277 catch(ex) { |
285 success = ex.name == 'TypeError'; | 278 success = ex.name == 'TypeError'; |
286 » » } | 279 } |
287 » » assertTrue("string_iterateNext_TYPE_ERR",success); | 280 assertTrue("string_iterateNext_TYPE_ERR",success); |
288 » } | 281 } |
289 | 282 |
290 » { | 283 { |
291 » » success = false; | 284 success = false; |
292 » » try { | 285 try { |
293 nodeValue = outresult.snapshotItem(0); | 286 nodeValue = outresult.snapshotItem(0); |
294 } | 287 } |
295 » » catch(ex) { | 288 catch(ex) { |
296 success = ex.name == 'TypeError'; | 289 success = ex.name == 'TypeError'; |
297 » » } | 290 } |
298 » » assertTrue("string_snapshotItem_TYPE_ERR",success); | 291 assertTrue("string_snapshotItem_TYPE_ERR",success); |
299 » } | 292 } |
300 | 293 |
301 » } | 294 } |
302 » | 295 |
303 » if( | 296 if( |
304 » (outNodeType == BOOLEAN_TYPE) | 297 (outNodeType == BOOLEAN_TYPE) |
305 » ) { | 298 ) { |
306 » | 299 |
307 » { | 300 { |
308 » » success = false; | 301 success = false; |
309 » » try { | 302 try { |
310 doubleValue = outresult.numberValue; | 303 doubleValue = outresult.numberValue; |
311 | 304 |
312 } | 305 } |
313 » » catch(ex) { | 306 catch(ex) { |
314 success = ex.name == 'TypeError'; | 307 success = ex.name == 'TypeError'; |
315 » » } | 308 } |
316 » » assertTrue("boolean_numberValue_TYPE_ERR",success); | 309 assertTrue("boolean_numberValue_TYPE_ERR",success); |
317 » } | 310 } |
318 | 311 |
319 » { | 312 { |
320 » » success = false; | 313 success = false; |
321 » » try { | 314 try { |
322 nodeValue = outresult.singleNodeValue; | 315 nodeValue = outresult.singleNodeValue; |
323 | 316 |
324 } | 317 } |
325 » » catch(ex) { | 318 catch(ex) { |
326 success = ex.name == 'TypeError'; | 319 success = ex.name == 'TypeError'; |
327 » » } | 320 } |
328 » » assertTrue("boolean_singleNodeValue_TYPE_ERR",success); | 321 assertTrue("boolean_singleNodeValue_TYPE_ERR",success); |
329 » } | 322 } |
330 | 323 |
331 » { | 324 { |
332 » » success = false; | 325 success = false; |
333 » » try { | 326 try { |
334 intValue = outresult.snapshotLength; | 327 intValue = outresult.snapshotLength; |
335 | 328 |
336 } | 329 } |
337 » » catch(ex) { | 330 catch(ex) { |
338 success = ex.name == 'TypeError'; | 331 success = ex.name == 'TypeError'; |
339 » » } | 332 } |
340 » » assertTrue("boolean_snapshotLength_TYPE_ERR",success); | 333 assertTrue("boolean_snapshotLength_TYPE_ERR",success); |
341 » } | 334 } |
342 | 335 |
343 » { | 336 { |
344 » » success = false; | 337 success = false; |
345 » » try { | 338 try { |
346 stringValue = outresult.stringValue; | 339 stringValue = outresult.stringValue; |
347 | 340 |
348 } | 341 } |
349 » » catch(ex) { | 342 catch(ex) { |
350 success = ex.name == 'TypeError'; | 343 success = ex.name == 'TypeError'; |
351 » » } | 344 } |
352 » » assertTrue("boolean_stringValue_TYPE_ERR",success); | 345 assertTrue("boolean_stringValue_TYPE_ERR",success); |
353 » } | 346 } |
354 | 347 |
355 » { | 348 { |
356 » » success = false; | 349 success = false; |
357 » » try { | 350 try { |
358 nodeValue = outresult.iterateNext(); | 351 nodeValue = outresult.iterateNext(); |
359 } | 352 } |
360 » » catch(ex) { | 353 catch(ex) { |
361 success = ex.name == 'TypeError'; | 354 success = ex.name == 'TypeError'; |
362 » » } | 355 } |
363 » » assertTrue("boolean_iterateNext_TYPE_ERR",success); | 356 assertTrue("boolean_iterateNext_TYPE_ERR",success); |
364 » } | 357 } |
365 | 358 |
366 » { | 359 { |
367 » » success = false; | 360 success = false; |
368 » » try { | 361 try { |
369 nodeValue = outresult.snapshotItem(0); | 362 nodeValue = outresult.snapshotItem(0); |
370 } | 363 } |
371 » » catch(ex) { | 364 catch(ex) { |
372 success = ex.name == 'TypeError'; | 365 success = ex.name == 'TypeError'; |
373 » » } | 366 } |
374 » » assertTrue("boolean_snapshotItem_TYPE_ERR",success); | 367 assertTrue("boolean_snapshotItem_TYPE_ERR",success); |
375 » } | 368 } |
376 | 369 |
377 » } | 370 } |
378 » | 371 |
379 » if( | 372 if( |
380 » (outNodeType == UNORDERED_NODE_ITERATOR_TYPE) | 373 (outNodeType == UNORDERED_NODE_ITERATOR_TYPE) |
381 » ) { | 374 ) { |
382 » | 375 |
383 » { | 376 { |
384 » » success = false; | 377 success = false; |
385 » » try { | 378 try { |
386 booleanValue = outresult.booleanValue; | 379 booleanValue = outresult.booleanValue; |
387 | 380 |
388 } | 381 } |
389 » » catch(ex) { | 382 catch(ex) { |
390 success = ex.name == 'TypeError'; | 383 success = ex.name == 'TypeError'; |
391 » » } | 384 } |
392 » » assertTrue("unordered_node_iterator_booleanValue_TYPE_ERR",succe
ss); | 385 assertTrue("unordered_node_iterator_booleanValue_TYPE_ERR",success); |
393 » } | 386 } |
394 | 387 |
395 » { | 388 { |
396 » » success = false; | 389 success = false; |
397 » » try { | 390 try { |
398 doubleValue = outresult.numberValue; | 391 doubleValue = outresult.numberValue; |
399 | 392 |
400 } | 393 } |
401 » » catch(ex) { | 394 catch(ex) { |
402 success = ex.name == 'TypeError'; | 395 success = ex.name == 'TypeError'; |
403 » » } | 396 } |
404 » » assertTrue("unordered_node_iterator_numberValue_TYPE_ERR",succes
s); | 397 assertTrue("unordered_node_iterator_numberValue_TYPE_ERR",success); |
405 » } | 398 } |
406 | 399 |
407 » { | 400 { |
408 » » success = false; | 401 success = false; |
409 » » try { | 402 try { |
410 nodeValue = outresult.singleNodeValue; | 403 nodeValue = outresult.singleNodeValue; |
411 | 404 |
412 } | 405 } |
413 » » catch(ex) { | 406 catch(ex) { |
414 success = ex.name == 'TypeError'; | 407 success = ex.name == 'TypeError'; |
415 » » } | 408 } |
416 » » assertTrue("unordered_node_iterator_singleNodeValue_TYPE_ERR",su
ccess); | 409 assertTrue("unordered_node_iterator_singleNodeValue_TYPE_ERR",success); |
417 » } | 410 } |
418 | 411 |
419 » { | 412 { |
420 » » success = false; | 413 success = false; |
421 » » try { | 414 try { |
422 intValue = outresult.snapshotLength; | 415 intValue = outresult.snapshotLength; |
423 | 416 |
424 } | 417 } |
425 » » catch(ex) { | 418 catch(ex) { |
426 success = ex.name == 'TypeError'; | 419 success = ex.name == 'TypeError'; |
427 » » } | 420 } |
428 » » assertTrue("unordered_node_iterator_snapshotLength_TYPE_ERR",suc
cess); | 421 assertTrue("unordered_node_iterator_snapshotLength_TYPE_ERR",success); |
429 » } | 422 } |
430 | 423 |
431 » { | 424 { |
432 » » success = false; | 425 success = false; |
433 » » try { | 426 try { |
434 stringValue = outresult.stringValue; | 427 stringValue = outresult.stringValue; |
435 | 428 |
436 } | 429 } |
437 » » catch(ex) { | 430 catch(ex) { |
438 success = ex.name == 'TypeError'; | 431 success = ex.name == 'TypeError'; |
439 » » } | 432 } |
440 » » assertTrue("unordered_node_iterator_stringValue_TYPE_ERR",succes
s); | 433 assertTrue("unordered_node_iterator_stringValue_TYPE_ERR",success); |
441 » } | 434 } |
442 | 435 |
443 » { | 436 { |
444 » » success = false; | 437 success = false; |
445 » » try { | 438 try { |
446 nodeValue = outresult.snapshotItem(0); | 439 nodeValue = outresult.snapshotItem(0); |
447 } | 440 } |
448 » » catch(ex) { | 441 catch(ex) { |
449 success = ex.name == 'TypeError'; | 442 success = ex.name == 'TypeError'; |
450 » » } | 443 } |
451 » » assertTrue("unordered_node_iterator_snapshotItem_TYPE_ERR",succe
ss); | 444 assertTrue("unordered_node_iterator_snapshotItem_TYPE_ERR",success); |
452 » } | 445 } |
453 | 446 |
454 » } | 447 } |
455 » | 448 |
456 » if( | 449 if( |
457 » (outNodeType == ORDERED_NODE_ITERATOR_TYPE) | 450 (outNodeType == ORDERED_NODE_ITERATOR_TYPE) |
458 » ) { | 451 ) { |
459 » | 452 |
460 » { | 453 { |
461 » » success = false; | 454 success = false; |
462 » » try { | 455 try { |
463 booleanValue = outresult.booleanValue; | 456 booleanValue = outresult.booleanValue; |
464 | 457 |
465 } | 458 } |
466 » » catch(ex) { | 459 catch(ex) { |
467 success = ex.name == 'TypeError'; | 460 success = ex.name == 'TypeError'; |
468 » » } | 461 } |
469 » » assertTrue("ordered_node_iterator_booleanValue_TYPE_ERR",success
); | 462 assertTrue("ordered_node_iterator_booleanValue_TYPE_ERR",success); |
470 » } | 463 } |
471 | 464 |
472 » { | 465 { |
473 » » success = false; | 466 success = false; |
474 » » try { | 467 try { |
475 doubleValue = outresult.numberValue; | 468 doubleValue = outresult.numberValue; |
476 | 469 |
477 } | 470 } |
478 » » catch(ex) { | 471 catch(ex) { |
479 success = ex.name == 'TypeError'; | 472 success = ex.name == 'TypeError'; |
480 » » } | 473 } |
481 » » assertTrue("ordered_node_iterator_numberValue_TYPE_ERR",success)
; | 474 assertTrue("ordered_node_iterator_numberValue_TYPE_ERR",success); |
482 » } | 475 } |
483 | 476 |
484 » { | 477 { |
485 » » success = false; | 478 success = false; |
486 » » try { | 479 try { |
487 nodeValue = outresult.singleNodeValue; | 480 nodeValue = outresult.singleNodeValue; |
488 | 481 |
489 } | 482 } |
490 » » catch(ex) { | 483 catch(ex) { |
491 success = ex.name == 'TypeError'; | 484 success = ex.name == 'TypeError'; |
492 » » } | 485 } |
493 » » assertTrue("ordered_node_iterator_singleNodeValue_TYPE_ERR",succ
ess); | 486 assertTrue("ordered_node_iterator_singleNodeValue_TYPE_ERR",success); |
494 » } | 487 } |
495 | 488 |
496 » { | 489 { |
497 » » success = false; | 490 success = false; |
498 » » try { | 491 try { |
499 intValue = outresult.snapshotLength; | 492 intValue = outresult.snapshotLength; |
500 | 493 |
501 } | 494 } |
502 » » catch(ex) { | 495 catch(ex) { |
503 success = ex.name == 'TypeError'; | 496 success = ex.name == 'TypeError'; |
504 » » } | 497 } |
505 » » assertTrue("ordered_node_iterator_snapshotLength_TYPE_ERR",succe
ss); | 498 assertTrue("ordered_node_iterator_snapshotLength_TYPE_ERR",success); |
506 » } | 499 } |
507 | 500 |
508 » { | 501 { |
509 » » success = false; | 502 success = false; |
510 » » try { | 503 try { |
511 stringValue = outresult.stringValue; | 504 stringValue = outresult.stringValue; |
512 | 505 |
513 } | 506 } |
514 » » catch(ex) { | 507 catch(ex) { |
515 success = ex.name == 'TypeError'; | 508 success = ex.name == 'TypeError'; |
516 » » } | 509 } |
517 » » assertTrue("ordered_node_iterator_stringValue_TYPE_ERR",success)
; | 510 assertTrue("ordered_node_iterator_stringValue_TYPE_ERR",success); |
518 » } | 511 } |
519 | 512 |
520 » { | 513 { |
521 » » success = false; | 514 success = false; |
522 » » try { | 515 try { |
523 nodeValue = outresult.snapshotItem(0); | 516 nodeValue = outresult.snapshotItem(0); |
524 } | 517 } |
525 » » catch(ex) { | 518 catch(ex) { |
526 success = ex.name == 'TypeError'; | 519 success = ex.name == 'TypeError'; |
527 » » } | 520 } |
528 » » assertTrue("ordered_node_iterator_snapshotItem_TYPE_ERR",success
); | 521 assertTrue("ordered_node_iterator_snapshotItem_TYPE_ERR",success); |
529 » } | 522 } |
530 | 523 |
531 » } | 524 } |
532 » | 525 |
533 » if( | 526 if( |
534 » (outNodeType == UNORDERED_NODE_SNAPSHOT_TYPE) | 527 (outNodeType == UNORDERED_NODE_SNAPSHOT_TYPE) |
535 » ) { | 528 ) { |
536 » | 529 |
537 » { | 530 { |
538 » » success = false; | 531 success = false; |
539 » » try { | 532 try { |
540 booleanValue = outresult.booleanValue; | 533 booleanValue = outresult.booleanValue; |
541 | 534 |
542 } | 535 } |
543 » » catch(ex) { | 536 catch(ex) { |
544 success = ex.name == 'TypeError'; | 537 success = ex.name == 'TypeError'; |
545 » » } | 538 } |
546 » » assertTrue("unordered_node_snapshot_booleanValue_TYPE_ERR",succe
ss); | 539 assertTrue("unordered_node_snapshot_booleanValue_TYPE_ERR",success); |
547 » } | 540 } |
548 | 541 |
549 » { | 542 { |
550 » » success = false; | 543 success = false; |
551 » » try { | 544 try { |
552 doubleValue = outresult.numberValue; | 545 doubleValue = outresult.numberValue; |
553 | 546 |
554 } | 547 } |
555 » » catch(ex) { | 548 catch(ex) { |
556 success = ex.name == 'TypeError'; | 549 success = ex.name == 'TypeError'; |
557 » » } | 550 } |
558 » » assertTrue("unordered_node_snapshot_numberValue_TYPE_ERR",succes
s); | 551 assertTrue("unordered_node_snapshot_numberValue_TYPE_ERR",success); |
559 » } | 552 } |
560 | 553 |
561 » { | 554 { |
562 » » success = false; | 555 success = false; |
563 » » try { | 556 try { |
564 nodeValue = outresult.singleNodeValue; | 557 nodeValue = outresult.singleNodeValue; |
565 | 558 |
566 } | 559 } |
567 » » catch(ex) { | 560 catch(ex) { |
568 success = ex.name == 'TypeError'; | 561 success = ex.name == 'TypeError'; |
569 » » } | 562 } |
570 » » assertTrue("unordered_node_snapshot_singleNodeValue_TYPE_ERR",su
ccess); | 563 assertTrue("unordered_node_snapshot_singleNodeValue_TYPE_ERR",success); |
571 » } | 564 } |
572 | 565 |
573 » { | 566 { |
574 » » success = false; | 567 success = false; |
575 » » try { | 568 try { |
576 stringValue = outresult.stringValue; | 569 stringValue = outresult.stringValue; |
577 | 570 |
578 } | 571 } |
579 » » catch(ex) { | 572 catch(ex) { |
580 success = ex.name == 'TypeError'; | 573 success = ex.name == 'TypeError'; |
581 » » } | 574 } |
582 » » assertTrue("unordered_node_snapshot_stringValue_TYPE_ERR",succes
s); | 575 assertTrue("unordered_node_snapshot_stringValue_TYPE_ERR",success); |
583 » } | 576 } |
584 | 577 |
585 » { | 578 { |
586 » » success = false; | 579 success = false; |
587 » » try { | 580 try { |
588 nodeValue = outresult.iterateNext(); | 581 nodeValue = outresult.iterateNext(); |
589 } | 582 } |
590 » » catch(ex) { | 583 catch(ex) { |
591 success = ex.name == 'TypeError'; | 584 success = ex.name == 'TypeError'; |
592 » » } | 585 } |
593 » » assertTrue("unordered_node_snapshot_iterateNext_TYPE_ERR",succes
s); | 586 assertTrue("unordered_node_snapshot_iterateNext_TYPE_ERR",success); |
594 » } | 587 } |
595 | 588 |
596 » } | 589 } |
597 » | 590 |
598 » if( | 591 if( |
599 » (outNodeType == ORDERED_NODE_SNAPSHOT_TYPE) | 592 (outNodeType == ORDERED_NODE_SNAPSHOT_TYPE) |
600 » ) { | 593 ) { |
601 » | 594 |
602 » { | 595 { |
603 » » success = false; | 596 success = false; |
604 » » try { | 597 try { |
605 booleanValue = outresult.booleanValue; | 598 booleanValue = outresult.booleanValue; |
606 | 599 |
607 } | 600 } |
608 » » catch(ex) { | 601 catch(ex) { |
609 success = ex.name == 'TypeError'; | 602 success = ex.name == 'TypeError'; |
610 » » } | 603 } |
611 » » assertTrue("ordered_node_snapshot_booleanValue_TYPE_ERR",success
); | 604 assertTrue("ordered_node_snapshot_booleanValue_TYPE_ERR",success); |
612 » } | 605 } |
613 | 606 |
614 » { | 607 { |
615 » » success = false; | 608 success = false; |
616 » » try { | 609 try { |
617 doubleValue = outresult.numberValue; | 610 doubleValue = outresult.numberValue; |
618 | 611 |
619 } | 612 } |
620 » » catch(ex) { | 613 catch(ex) { |
621 success = ex.name == 'TypeError'; | 614 success = ex.name == 'TypeError'; |
622 » » } | 615 } |
623 » » assertTrue("ordered_node_snapshot_numberValue_TYPE_ERR",success)
; | 616 assertTrue("ordered_node_snapshot_numberValue_TYPE_ERR",success); |
624 » } | 617 } |
625 | 618 |
626 » { | 619 { |
627 » » success = false; | 620 success = false; |
628 » » try { | 621 try { |
629 nodeValue = outresult.singleNodeValue; | 622 nodeValue = outresult.singleNodeValue; |
630 | 623 |
631 } | 624 } |
632 » » catch(ex) { | 625 catch(ex) { |
633 success = ex.name == 'TypeError'; | 626 success = ex.name == 'TypeError'; |
634 » » } | 627 } |
635 » » assertTrue("ordered_node_snapshot_singleNodeValue_TYPE_ERR",succ
ess); | 628 assertTrue("ordered_node_snapshot_singleNodeValue_TYPE_ERR",success); |
636 » } | 629 } |
637 | 630 |
638 » { | 631 { |
639 » » success = false; | 632 success = false; |
640 » » try { | 633 try { |
641 stringValue = outresult.stringValue; | 634 stringValue = outresult.stringValue; |
642 | 635 |
643 } | 636 } |
644 » » catch(ex) { | 637 catch(ex) { |
645 success = ex.name == 'TypeError'; | 638 success = ex.name == 'TypeError'; |
646 » » } | 639 } |
647 » » assertTrue("ordered_node_snapshot_stringValue_TYPE_ERR",success)
; | 640 assertTrue("ordered_node_snapshot_stringValue_TYPE_ERR",success); |
648 » } | 641 } |
649 | 642 |
650 » { | 643 { |
651 » » success = false; | 644 success = false; |
652 » » try { | 645 try { |
653 nodeValue = outresult.iterateNext(); | 646 nodeValue = outresult.iterateNext(); |
654 } | 647 } |
655 » » catch(ex) { | 648 catch(ex) { |
656 success = ex.name == 'TypeError'; | 649 success = ex.name == 'TypeError'; |
657 » » } | 650 } |
658 » » assertTrue("ordered_node_snapshot_iterateNext_TYPE_ERR",success)
; | 651 assertTrue("ordered_node_snapshot_iterateNext_TYPE_ERR",success); |
659 » } | 652 } |
660 | 653 |
661 » } | 654 } |
662 » | 655 |
663 » if( | 656 if( |
664 » (outNodeType == ANY_UNORDERED_NODE_TYPE) | 657 (outNodeType == ANY_UNORDERED_NODE_TYPE) |
665 » ) { | 658 ) { |
666 » | 659 |
667 » { | 660 { |
668 » » success = false; | 661 success = false; |
669 » » try { | 662 try { |
670 booleanValue = outresult.booleanValue; | 663 booleanValue = outresult.booleanValue; |
671 | 664 |
672 } | 665 } |
673 » » catch(ex) { | 666 catch(ex) { |
674 success = ex.name == 'TypeError'; | 667 success = ex.name == 'TypeError'; |
675 » » } | 668 } |
676 » » assertTrue("any_unordered_node_booleanValue_TYPE_ERR",success); | 669 assertTrue("any_unordered_node_booleanValue_TYPE_ERR",success); |
677 » } | 670 } |
678 | 671 |
679 » { | 672 { |
680 » » success = false; | 673 success = false; |
681 » » try { | 674 try { |
682 doubleValue = outresult.numberValue; | 675 doubleValue = outresult.numberValue; |
683 | 676 |
684 } | 677 } |
685 » » catch(ex) { | 678 catch(ex) { |
686 success = ex.name == 'TypeError'; | 679 success = ex.name == 'TypeError'; |
687 » » } | 680 } |
688 » » assertTrue("any_unordered_node_numberValue_TYPE_ERR",success); | 681 assertTrue("any_unordered_node_numberValue_TYPE_ERR",success); |
689 » } | 682 } |
690 | 683 |
691 » { | 684 { |
692 » » success = false; | 685 success = false; |
693 » » try { | 686 try { |
694 intValue = outresult.snapshotLength; | 687 intValue = outresult.snapshotLength; |
695 | 688 |
696 } | 689 } |
697 » » catch(ex) { | 690 catch(ex) { |
698 success = ex.name == 'TypeError'; | 691 success = ex.name == 'TypeError'; |
699 » » } | 692 } |
700 » » assertTrue("any_unordered_node_snapshotLength_TYPE_ERR",success)
; | 693 assertTrue("any_unordered_node_snapshotLength_TYPE_ERR",success); |
701 » } | 694 } |
702 | 695 |
703 » { | 696 { |
704 » » success = false; | 697 success = false; |
705 » » try { | 698 try { |
706 stringValue = outresult.stringValue; | 699 stringValue = outresult.stringValue; |
707 | 700 |
708 } | 701 } |
709 » » catch(ex) { | 702 catch(ex) { |
710 success = ex.name == 'TypeError'; | 703 success = ex.name == 'TypeError'; |
711 » » } | 704 } |
712 » » assertTrue("any_unordered_node_stringValue_TYPE_ERR",success); | 705 assertTrue("any_unordered_node_stringValue_TYPE_ERR",success); |
713 » } | 706 } |
714 | 707 |
715 » { | 708 { |
716 » » success = false; | 709 success = false; |
717 » » try { | 710 try { |
718 nodeValue = outresult.iterateNext(); | 711 nodeValue = outresult.iterateNext(); |
719 } | 712 } |
720 » » catch(ex) { | 713 catch(ex) { |
721 success = ex.name == 'TypeError'; | 714 success = ex.name == 'TypeError'; |
722 » » } | 715 } |
723 » » assertTrue("any_unordered_node_iterateNext_TYPE_ERR",success); | 716 assertTrue("any_unordered_node_iterateNext_TYPE_ERR",success); |
724 » } | 717 } |
725 | 718 |
726 » { | 719 { |
727 » » success = false; | 720 success = false; |
728 » » try { | 721 try { |
729 nodeValue = outresult.snapshotItem(0); | 722 nodeValue = outresult.snapshotItem(0); |
730 } | 723 } |
731 » » catch(ex) { | 724 catch(ex) { |
732 success = ex.name == 'TypeError'; | 725 success = ex.name == 'TypeError'; |
733 » » } | 726 } |
734 » » assertTrue("any_unordered_node_snapshotItem_TYPE_ERR",success); | 727 assertTrue("any_unordered_node_snapshotItem_TYPE_ERR",success); |
735 » } | 728 } |
736 | 729 |
737 » } | 730 } |
738 » | 731 |
739 » if( | 732 if( |
740 » (outNodeType == FIRST_ORDERED_NODE_TYPE) | 733 (outNodeType == FIRST_ORDERED_NODE_TYPE) |
741 » ) { | 734 ) { |
742 » | 735 |
743 » { | 736 { |
744 » » success = false; | 737 success = false; |
745 » » try { | 738 try { |
746 booleanValue = outresult.booleanValue; | 739 booleanValue = outresult.booleanValue; |
747 | 740 |
748 } | 741 } |
749 » » catch(ex) { | 742 catch(ex) { |
750 success = ex.name == 'TypeError'; | 743 success = ex.name == 'TypeError'; |
751 » » } | 744 } |
752 » » assertTrue("first_ordered_node_booleanValue_TYPE_ERR",success); | 745 assertTrue("first_ordered_node_booleanValue_TYPE_ERR",success); |
753 » } | 746 } |
754 | 747 |
755 » { | 748 { |
756 » » success = false; | 749 success = false; |
757 » » try { | 750 try { |
758 doubleValue = outresult.numberValue; | 751 doubleValue = outresult.numberValue; |
759 | 752 |
760 } | 753 } |
761 » » catch(ex) { | 754 catch(ex) { |
762 success = ex.name == 'TypeError'; | 755 success = ex.name == 'TypeError'; |
763 » » } | 756 } |
764 » » assertTrue("first_ordered_node_numberValue_TYPE_ERR",success); | 757 assertTrue("first_ordered_node_numberValue_TYPE_ERR",success); |
765 » } | 758 } |
766 | 759 |
767 » { | 760 { |
768 » » success = false; | 761 success = false; |
769 » » try { | 762 try { |
770 intValue = outresult.snapshotLength; | 763 intValue = outresult.snapshotLength; |
771 | 764 |
772 } | 765 } |
773 » » catch(ex) { | 766 catch(ex) { |
774 success = ex.name == 'TypeError'; | 767 success = ex.name == 'TypeError'; |
775 » » } | 768 } |
776 » » assertTrue("first_ordered_node_snapshotLength_TYPE_ERR",success)
; | 769 assertTrue("first_ordered_node_snapshotLength_TYPE_ERR",success); |
777 » } | 770 } |
778 | 771 |
779 » { | 772 { |
780 » » success = false; | 773 success = false; |
781 » » try { | 774 try { |
782 stringValue = outresult.stringValue; | 775 stringValue = outresult.stringValue; |
783 | 776 |
784 } | 777 } |
785 » » catch(ex) { | 778 catch(ex) { |
786 success = ex.name == 'TypeError'; | 779 success = ex.name == 'TypeError'; |
787 » » } | 780 } |
788 » » assertTrue("first_ordered_node_stringValue_TYPE_ERR",success); | 781 assertTrue("first_ordered_node_stringValue_TYPE_ERR",success); |
789 » } | 782 } |
790 | 783 |
791 » { | 784 { |
792 » » success = false; | 785 success = false; |
793 » » try { | 786 try { |
794 nodeValue = outresult.iterateNext(); | 787 nodeValue = outresult.iterateNext(); |
795 } | 788 } |
796 » » catch(ex) { | 789 catch(ex) { |
797 success = ex.name == 'TypeError'; | 790 success = ex.name == 'TypeError'; |
798 » » } | 791 } |
799 » » assertTrue("first_ordered_node_iterateNext_TYPE_ERR",success); | 792 assertTrue("first_ordered_node_iterateNext_TYPE_ERR",success); |
800 » } | 793 } |
801 | 794 |
802 » { | 795 { |
803 » » success = false; | 796 success = false; |
804 » » try { | 797 try { |
805 nodeValue = outresult.snapshotItem(0); | 798 nodeValue = outresult.snapshotItem(0); |
806 } | 799 } |
807 » » catch(ex) { | 800 catch(ex) { |
808 success = ex.name == 'TypeError'; | 801 success = ex.name == 'TypeError'; |
809 » » } | 802 } |
810 » » assertTrue("first_ordered_node_snapshotItem_TYPE_ERR",success); | 803 assertTrue("first_ordered_node_snapshotItem_TYPE_ERR",success); |
811 » } | 804 } |
812 | 805 |
813 » } | 806 } |
814 » | 807 |
815 » } | 808 } |
816 | 809 |
817 } | 810 } |
818 | 811 |
819 | |
820 | |
821 | |
822 function runTest() { | 812 function runTest() { |
823 XPathResult_TYPE_ERR(); | 813 XPathResult_TYPE_ERR(); |
824 } | 814 } |
OLD | NEW |