|
1 // Create a DOM tree for a simple SMIL file |
|
2 |
|
3 createdomtree |
|
4 setatt id "1 smil" |
|
5 getatt id |
|
6 getid |
|
7 create head append |
|
8 create body append |
|
9 firstchild |
|
10 setatt id "1.1 head" |
|
11 nextsibling |
|
12 setatt id "1.2 body" |
|
13 prevsibling |
|
14 create layout append |
|
15 firstchild |
|
16 setid "1.1.1 layout first value" |
|
17 getid |
|
18 getatt id |
|
19 removeid |
|
20 getatt id |
|
21 setatt id "1.1.1 layout" |
|
22 getid |
|
23 create region append |
|
24 firstchild |
|
25 setatt id "1.1.1.3 region" |
|
26 parent |
|
27 create root-layout insert 1 |
|
28 firstchild |
|
29 setatt id "1.1.1.1 root-layout" |
|
30 parent |
|
31 create region insert 2 |
|
32 firstchild |
|
33 nextsibling |
|
34 setatt id "1.1.1.2 region" |
|
35 rootsmil |
|
36 lastchild |
|
37 create par insert 0 |
|
38 lastchild |
|
39 setatt id "1.2.1 par" |
|
40 create text insert 0 |
|
41 lastchild |
|
42 setatt id "1.2.1.2 text" |
|
43 parent |
|
44 create audio append |
|
45 create img insert 1 |
|
46 lastchild |
|
47 setatt id "1.2.1.3 audio" |
|
48 |
|
49 // Exercise the attribute access routines with valid and invalid |
|
50 // attribute names and values. GT121UT3204 - GT121UT3206. |
|
51 |
|
52 setatt fill hold |
|
53 getatt fill |
|
54 |
|
55 unsetatt fill |
|
56 getatt fill |
|
57 |
|
58 // Invalid attribute name |
|
59 setatt fills hold |
|
60 getatt fills |
|
61 unsetatt fills |
|
62 |
|
63 // Invalid attribute value |
|
64 unsetatt fill |
|
65 setatt fill holds |
|
66 getatt fill |
|
67 |
|
68 |
|
69 setatt systemCaptions on |
|
70 getatt systemCaptions |
|
71 |
|
72 unsetatt systemCaptions |
|
73 getatt systemCaptions |
|
74 |
|
75 // Invalid attribute name |
|
76 setatt systemCaption off |
|
77 getatt systemCaption |
|
78 unsetatt systemCaption |
|
79 |
|
80 // Invalid attribute value |
|
81 unsetatt systemCaptions |
|
82 setatt systemCaptions onf |
|
83 getatt systemCaptions |
|
84 |
|
85 |
|
86 setatt author "Fred Smith" |
|
87 getatt author |
|
88 |
|
89 unsetatt author |
|
90 getatt author |
|
91 |
|
92 // Invalid attribute name |
|
93 setatt authr "Fred Smith" |
|
94 getatt authr |
|
95 unsetatt authr |
|
96 |
|
97 // Valid attributes for timed media elements |
|
98 setatt clipBegin "now" |
|
99 setatt clipEnd "then" |
|
100 getatt clipBegin |
|
101 getatt clipEnd |
|
102 |
|
103 // Resume creating the rest of the tree |
|
104 prevsibling |
|
105 prevsibling |
|
106 setatt id "1.2.1.1 img" |
|
107 |
|
108 // Valid attributes for timed media elements but invalid for img & text |
|
109 setatt clipBegin "now" |
|
110 setatt clipEnd "then" |
|
111 getatt clipBegin |
|
112 getatt clipEnd |
|
113 |
|
114 // Navigation Tests GT121UT3203 |
|
115 |
|
116 // Attempt to navigate off the ends of child lists |
|
117 |
|
118 // This should return an error: |
|
119 prevsibling |
|
120 |
|
121 nextsibling |
|
122 nextsibling |
|
123 |
|
124 // This should return an error: |
|
125 nextsibling |
|
126 |
|
127 |
|
128 // Attempt to navigate into non-existent child element lists |
|
129 |
|
130 // This should return an error: |
|
131 firstchild |
|
132 |
|
133 // This should return an error: |
|
134 lastchild |
|
135 |
|
136 |
|
137 // Attempt to navigate off the root of the DOM tree |
|
138 parent |
|
139 parent |
|
140 parent |
|
141 |
|
142 // This should return an error: |
|
143 parent |
|
144 |
|
145 |
|
146 // We should be at the 'smil' element, and all of the children in the tree should be legal |
|
147 getatt id |
|
148 legalchildren |
|
149 |
|
150 // Navigate to the 'par' |
|
151 lastchild |
|
152 lastchild |
|
153 getatt id |
|
154 |
|
155 // Element Creation and Insertion with Valid Arguments Test GT121UT3201 |
|
156 |
|
157 // Append each element type to child list |
|
158 create a append |
|
159 create anchor append |
|
160 create animation append |
|
161 create area append |
|
162 create audio append |
|
163 create body append |
|
164 create head append |
|
165 create img append |
|
166 create layout append |
|
167 create meta append |
|
168 create par append |
|
169 create ref append |
|
170 create region append |
|
171 create root-layout append |
|
172 create seq append |
|
173 create switch append |
|
174 create text append |
|
175 create textstream append |
|
176 create video append |
|
177 |
|
178 // Not all of these are legal children |
|
179 legalchildren |
|
180 |
|
181 // Give them ids |
|
182 firstchild |
|
183 nextsibling |
|
184 nextsibling |
|
185 nextsibling |
|
186 setatt id "a appended" |
|
187 nextsibling |
|
188 setatt id "anchor appended" |
|
189 nextsibling |
|
190 setatt id "animation appended" |
|
191 nextsibling |
|
192 setatt id "area appended" |
|
193 nextsibling |
|
194 setatt id "audio appended" |
|
195 nextsibling |
|
196 setatt id "body appended" |
|
197 nextsibling |
|
198 setatt id "head appended" |
|
199 nextsibling |
|
200 setatt id "img appended" |
|
201 nextsibling |
|
202 setatt id "layout appended" |
|
203 nextsibling |
|
204 |
|
205 // This should return an error. Meta doesn't have an id attribute. |
|
206 setatt id "meta appended" |
|
207 |
|
208 nextsibling |
|
209 setatt id "par appended" |
|
210 nextsibling |
|
211 setatt id "ref appended" |
|
212 nextsibling |
|
213 setatt id "region appended" |
|
214 nextsibling |
|
215 setatt id "root-layout appended" |
|
216 nextsibling |
|
217 setatt id "seq appended" |
|
218 nextsibling |
|
219 setatt id "switch appended" |
|
220 nextsibling |
|
221 setatt id "text appended" |
|
222 nextsibling |
|
223 setatt id "textstream appended" |
|
224 nextsibling |
|
225 setatt id "video appended" |
|
226 |
|
227 // Confirm that we are at the end of the list |
|
228 nextsibling |
|
229 |
|
230 // Now Insert another set of elements, of each type, in the child list |
|
231 parent |
|
232 |
|
233 create a insert 1 |
|
234 create anchor insert 2 |
|
235 create animation insert 3 |
|
236 create area insert 4 |
|
237 create audio insert 5 |
|
238 create body insert 6 |
|
239 create head insert 7 |
|
240 create img insert 8 |
|
241 create layout insert 9 |
|
242 create meta insert 10 |
|
243 create par insert 11 |
|
244 create ref insert 12 |
|
245 create region insert 13 |
|
246 create root-layout insert 14 |
|
247 create seq insert 15 |
|
248 create switch insert 16 |
|
249 create text insert 17 |
|
250 create textstream insert 18 |
|
251 create video insert 19 |
|
252 |
|
253 // Give them ids |
|
254 firstchild |
|
255 setatt id "a inserted" |
|
256 nextsibling |
|
257 setatt id "anchor inserted" |
|
258 nextsibling |
|
259 setatt id "animation inserted" |
|
260 nextsibling |
|
261 setatt id "area inserted" |
|
262 nextsibling |
|
263 setatt id "audio inserted" |
|
264 nextsibling |
|
265 setatt id "body inserted" |
|
266 nextsibling |
|
267 setatt id "head inserted" |
|
268 nextsibling |
|
269 setatt id "img inserted" |
|
270 nextsibling |
|
271 setatt id "layout inserted" |
|
272 nextsibling |
|
273 |
|
274 // This should return an error. Meta doesn't have an id attribute. |
|
275 setatt id "meta inserted" |
|
276 |
|
277 nextsibling |
|
278 setatt id "par inserted" |
|
279 nextsibling |
|
280 setatt id "ref inserted" |
|
281 nextsibling |
|
282 setatt id "region inserted" |
|
283 nextsibling |
|
284 setatt id "root-layout inserted" |
|
285 nextsibling |
|
286 setatt id "seq inserted" |
|
287 nextsibling |
|
288 setatt id "switch inserted" |
|
289 nextsibling |
|
290 setatt id "text inserted" |
|
291 nextsibling |
|
292 setatt id "textstream inserted" |
|
293 nextsibling |
|
294 setatt id "video inserted" |
|
295 |
|
296 // Confirm that the next sibling is 1.2.1.1 img |
|
297 nextsibling |
|
298 getatt id |
|
299 |
|
300 // Now create another set of elements, of each type, and Replace some of the existing elements |
|
301 parent |
|
302 |
|
303 create a replace 1 |
|
304 create anchor replace 3 |
|
305 create animation replace 5 |
|
306 create area replace 7 |
|
307 create audio replace 9 |
|
308 create body replace 11 |
|
309 create head replace 13 |
|
310 create img replace 15 |
|
311 create layout replace 17 |
|
312 create meta replace 19 |
|
313 create par replace 23 |
|
314 create ref replace 25 |
|
315 create region replace 27 |
|
316 create root-layout replace 29 |
|
317 create seq replace 31 |
|
318 create switch replace 33 |
|
319 create text replace 35 |
|
320 create textstream replace 37 |
|
321 create video replace 39 |
|
322 |
|
323 // Leave the replacement element ids unset, and check what ids we have |
|
324 |
|
325 // 'a' element, id not set |
|
326 firstchild |
|
327 getatt id |
|
328 |
|
329 // anchor |
|
330 nextsibling |
|
331 getatt id |
|
332 |
|
333 // anchor, id not set |
|
334 nextsibling |
|
335 getatt id |
|
336 |
|
337 // area |
|
338 nextsibling |
|
339 getatt id |
|
340 |
|
341 // animation, id not set |
|
342 nextsibling |
|
343 getatt id |
|
344 |
|
345 // body |
|
346 nextsibling |
|
347 getatt id |
|
348 |
|
349 // area, id not set |
|
350 nextsibling |
|
351 getatt id |
|
352 |
|
353 // img |
|
354 nextsibling |
|
355 getatt id |
|
356 |
|
357 // audio, id not set |
|
358 nextsibling |
|
359 getatt id |
|
360 |
|
361 // meta, does not have an id attribute |
|
362 nextsibling |
|
363 getatt id |
|
364 |
|
365 // body, id not set |
|
366 nextsibling |
|
367 getatt id |
|
368 |
|
369 // ref |
|
370 nextsibling |
|
371 getatt id |
|
372 |
|
373 // head, id not set |
|
374 nextsibling |
|
375 getatt id |
|
376 |
|
377 // root-layout |
|
378 nextsibling |
|
379 getatt id |
|
380 |
|
381 // img, id not set |
|
382 nextsibling |
|
383 getatt id |
|
384 |
|
385 // switch |
|
386 nextsibling |
|
387 getatt id |
|
388 |
|
389 // layout, id not set |
|
390 nextsibling |
|
391 getatt id |
|
392 |
|
393 // textstream |
|
394 nextsibling |
|
395 getatt id |
|
396 |
|
397 // meta, does not have an id attribute |
|
398 nextsibling |
|
399 getatt id |
|
400 |
|
401 |
|
402 // 1.2.1.1 img |
|
403 nextsibling |
|
404 getatt id |
|
405 |
|
406 // 1.2.1.2 text |
|
407 nextsibling |
|
408 getatt id |
|
409 |
|
410 // 1.2.1.3 audio |
|
411 nextsibling |
|
412 getatt id |
|
413 |
|
414 |
|
415 // par, id not set |
|
416 nextsibling |
|
417 getatt id |
|
418 |
|
419 // anchor |
|
420 nextsibling |
|
421 getatt id |
|
422 |
|
423 // ref, id not set |
|
424 nextsibling |
|
425 getatt id |
|
426 |
|
427 // area |
|
428 nextsibling |
|
429 getatt id |
|
430 |
|
431 // region, id not set |
|
432 nextsibling |
|
433 getatt id |
|
434 |
|
435 // body |
|
436 nextsibling |
|
437 getatt id |
|
438 |
|
439 // root-layout, id not set |
|
440 nextsibling |
|
441 getatt id |
|
442 |
|
443 // img |
|
444 nextsibling |
|
445 getatt id |
|
446 |
|
447 // seq, id not set |
|
448 nextsibling |
|
449 getatt id |
|
450 |
|
451 // meta, does not have an id attribute |
|
452 nextsibling |
|
453 getatt id |
|
454 |
|
455 // switch, id not set |
|
456 nextsibling |
|
457 getatt id |
|
458 |
|
459 // ref |
|
460 nextsibling |
|
461 getatt id |
|
462 |
|
463 // text, id not set |
|
464 nextsibling |
|
465 getatt id |
|
466 |
|
467 // root-layout |
|
468 nextsibling |
|
469 getatt id |
|
470 |
|
471 // textstream, id not set |
|
472 nextsibling |
|
473 getatt id |
|
474 |
|
475 // switch |
|
476 nextsibling |
|
477 getatt id |
|
478 |
|
479 // video, id not set |
|
480 nextsibling |
|
481 getatt id |
|
482 |
|
483 // textstream |
|
484 nextsibling |
|
485 getatt id |
|
486 |
|
487 // video |
|
488 nextsibling |
|
489 getatt id |
|
490 |
|
491 // Confirm that we are at the end of the list |
|
492 nextsibling |
|
493 |
|
494 |
|
495 // Delete all of the elements that were replaced, and check again what ids we have in the child list. |
|
496 parent |
|
497 |
|
498 deletechild 39 |
|
499 deletechild 37 |
|
500 deletechild 35 |
|
501 deletechild 33 |
|
502 deletechild 31 |
|
503 deletechild 29 |
|
504 deletechild 27 |
|
505 deletechild 25 |
|
506 deletechild 23 |
|
507 deletechild 19 |
|
508 deletechild 17 |
|
509 deletechild 15 |
|
510 deletechild 13 |
|
511 deletechild 11 |
|
512 deletechild 9 |
|
513 deletechild 7 |
|
514 deletechild 5 |
|
515 deletechild 3 |
|
516 deletechild 1 |
|
517 |
|
518 // Check what ids we have |
|
519 |
|
520 // anchor |
|
521 firstchild |
|
522 getatt id |
|
523 |
|
524 // area |
|
525 nextsibling |
|
526 getatt id |
|
527 |
|
528 // body |
|
529 nextsibling |
|
530 getatt id |
|
531 |
|
532 // img |
|
533 nextsibling |
|
534 getatt id |
|
535 |
|
536 // meta, does not have an id attribute |
|
537 nextsibling |
|
538 getatt id |
|
539 |
|
540 // ref |
|
541 nextsibling |
|
542 getatt id |
|
543 |
|
544 // root-layout |
|
545 nextsibling |
|
546 getatt id |
|
547 |
|
548 // switch |
|
549 nextsibling |
|
550 getatt id |
|
551 |
|
552 // textstream |
|
553 nextsibling |
|
554 getatt id |
|
555 |
|
556 |
|
557 // 1.2.1.1 img |
|
558 nextsibling |
|
559 getatt id |
|
560 |
|
561 // 1.2.1.2 text |
|
562 nextsibling |
|
563 getatt id |
|
564 |
|
565 // 1.2.1.3 audio |
|
566 nextsibling |
|
567 getatt id |
|
568 |
|
569 |
|
570 // anchor |
|
571 nextsibling |
|
572 getatt id |
|
573 |
|
574 // area |
|
575 nextsibling |
|
576 getatt id |
|
577 |
|
578 // body |
|
579 nextsibling |
|
580 getatt id |
|
581 |
|
582 // img |
|
583 nextsibling |
|
584 getatt id |
|
585 |
|
586 // meta, does not have an id attribute |
|
587 nextsibling |
|
588 getatt id |
|
589 |
|
590 // ref |
|
591 nextsibling |
|
592 getatt id |
|
593 |
|
594 // root-layout |
|
595 nextsibling |
|
596 getatt id |
|
597 |
|
598 // switch |
|
599 nextsibling |
|
600 getatt id |
|
601 |
|
602 // textstream |
|
603 nextsibling |
|
604 getatt id |
|
605 |
|
606 // video |
|
607 nextsibling |
|
608 getatt id |
|
609 |
|
610 // Confirm that we are at the end of the list |
|
611 nextsibling |
|
612 |
|
613 |
|
614 // Test the functions of type |
|
615 // First<element type>Child() |
|
616 // Last<element type>Child() |
|
617 // Next<element type>Sibling() |
|
618 // Previous<element type>Sibling() |
|
619 parent |
|
620 |
|
621 first img |
|
622 getatt id |
|
623 |
|
624 next img |
|
625 getatt id |
|
626 |
|
627 // This will be invalid |
|
628 next audio |
|
629 |
|
630 next img |
|
631 getatt id |
|
632 |
|
633 // Confirm that there are no more |
|
634 next img |
|
635 |
|
636 parent |
|
637 |
|
638 last img |
|
639 getatt id |
|
640 |
|
641 prev img |
|
642 getatt id |
|
643 |
|
644 prev img |
|
645 getatt id |
|
646 |
|
647 // Confirm that there are no more |
|
648 prev img |
|
649 |
|
650 parent |
|
651 |
|
652 // There is no such function for this element type |
|
653 first area |
|
654 |
|
655 first ref |
|
656 getatt id |
|
657 |
|
658 next ref |
|
659 getatt id |
|
660 |
|
661 // Confirm that there are no more |
|
662 next ref |
|
663 |
|
664 parent |
|
665 |
|
666 last ref |
|
667 getatt id |
|
668 |
|
669 prev ref |
|
670 getatt id |
|
671 |
|
672 // Confirm that there are no more |
|
673 prev ref |
|
674 |
|
675 parent |
|
676 |
|
677 first textstream |
|
678 getatt id |
|
679 |
|
680 next textstream |
|
681 getatt id |
|
682 |
|
683 // Confirm that there are no more |
|
684 next textstream |
|
685 |
|
686 parent |
|
687 |
|
688 last textstream |
|
689 getatt id |
|
690 |
|
691 prev textstream |
|
692 getatt id |
|
693 |
|
694 // Confirm that there are no more |
|
695 prev textstream |
|
696 |
|
697 parent |
|
698 |
|
699 first text |
|
700 getatt id |
|
701 |
|
702 // Confirm that there are no more |
|
703 next text |
|
704 |
|
705 parent |
|
706 |
|
707 last text |
|
708 getatt id |
|
709 |
|
710 // Confirm that there are no more |
|
711 prev text |
|
712 |
|
713 parent |
|
714 |
|
715 first audio |
|
716 getatt id |
|
717 |
|
718 // Confirm that there are no more |
|
719 next audio |
|
720 |
|
721 parent |
|
722 |
|
723 last audio |
|
724 getatt id |
|
725 |
|
726 // Confirm that there are no more |
|
727 prev audio |
|
728 |
|
729 parent |
|
730 |
|
731 first video |
|
732 getatt id |
|
733 |
|
734 // Confirm that there are no more |
|
735 next video |
|
736 |
|
737 parent |
|
738 |
|
739 last video |
|
740 getatt id |
|
741 |
|
742 // Confirm that there are no more |
|
743 prev video |
|
744 |
|
745 parent |
|
746 |
|
747 // Attempt to navigate to a valid element type, that is not there |
|
748 first seq |
|
749 last seq |
|
750 |
|
751 |
|
752 // Element Creation and Insertion, with Invalid Arguments Test GT121UT3202 |
|
753 |
|
754 // Use n = -3 for start of list (specified with NULL parameter), |
|
755 // and no element to insert. |
|
756 create a insert -3 |
|
757 create anchor insert -3 |
|
758 create animation insert -3 |
|
759 |
|
760 // Use n = -2 for start of list (specified with pointer to first child), |
|
761 // and no element to insert. |
|
762 create a insert -2 |
|
763 create anchor insert -2 |
|
764 create animation insert -2 |
|
765 |
|
766 // Use n = -1 for invalid pointer specifying place to insert. |
|
767 create a insert -1 |
|
768 create anchor insert -1 |
|
769 create animation insert -1 |
|
770 |
|
771 |
|
772 // Use n = -2 for start of list, and no element to insert. |
|
773 create area replace -2 |
|
774 create audio replace -2 |
|
775 create body replace -2 |
|
776 |
|
777 // Use n = -1 for invalid pointer specifying child to replace. |
|
778 create area replace -1 |
|
779 create audio replace -1 |
|
780 create body replace -1 |
|
781 |
|
782 // Use n = 0 for NULL, in place of pointer to child to replace. |
|
783 create area replace 0 |
|
784 create audio replace 0 |
|
785 create body replace 0 |
|
786 |
|
787 |
|
788 // Try the Delete (remove child) function with invalid arguments. |
|
789 |
|
790 // Use n = -1 for invalid pointer specifying child to remove. |
|
791 deletechild -1 |
|
792 |
|
793 // Use n = 0 for NULL, in place of pointer to child to remove. |
|
794 deletechild 0 |