OLD | NEW |
| (Empty) |
1 ABC | |
2 ABC | |
3 This is a test of the SVGLengthList::insertItemBefore() API. | |
4 | |
5 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
6 | |
7 | |
8 | |
9 Create three SVGLength objects, with values=50,100,150 | |
10 PASS newLength1.value is 50 | |
11 PASS newLength2.value is 100 | |
12 PASS newLength3.value is 150 | |
13 PASS newLength1 != newLength2 is true | |
14 PASS newLength2 != newLength3 is true | |
15 PASS newLength3 != newLength1 is true | |
16 PASS newLength1.value == newLength2.value - 50 is true | |
17 PASS newLength2.value + 50 == newLength3.value is true | |
18 | |
19 Check initial list state | |
20 PASS text1.x.baseVal.numberOfItems is 3 | |
21 PASS text1.x.baseVal.getItem(0).value is 500 | |
22 PASS text1.x.baseVal.getItem(1).value is 1000 | |
23 PASS text1.x.baseVal.getItem(2).value is 1500 | |
24 PASS text1.x.baseVal.getItem(3) threw exception IndexSizeError: Failed to execut
e 'getItem' on 'SVGLengthList': The index provided (3) is greater than or equal
to the maximum bound (3).. | |
25 | |
26 Insert item 'newLength1' at the end of the list, by using a large index | |
27 PASS text1.x.baseVal.insertItemBefore(newLength1, 1000) is newLength1 | |
28 PASS text1.x.baseVal.numberOfItems is 4 | |
29 PASS text1.x.baseVal.getItem(0).value is 500 | |
30 PASS text1.x.baseVal.getItem(1).value is 1000 | |
31 PASS text1.x.baseVal.getItem(2).value is 1500 | |
32 PASS text1.x.baseVal.getItem(3).value is 50 | |
33 PASS text1.x.baseVal.getItem(4) threw exception IndexSizeError: Failed to execut
e 'getItem' on 'SVGLengthList': The index provided (4) is greater than or equal
to the maximum bound (4).. | |
34 | |
35 Storing getItem(0/1/2) in local variables | |
36 | |
37 Insert item 'newLength2' at the front of the list, by using index=0 | |
38 PASS text1.x.baseVal.insertItemBefore(newLength2, 0) is newLength2 | |
39 PASS text1.x.baseVal.numberOfItems is 5 | |
40 PASS text1.x.baseVal.getItem(0).value is 100 | |
41 PASS text1.x.baseVal.getItem(1).value is 500 | |
42 PASS text1.x.baseVal.getItem(2).value is 1000 | |
43 PASS text1.x.baseVal.getItem(3).value is 1500 | |
44 PASS text1.x.baseVal.getItem(4).value is 50 | |
45 PASS text1.x.baseVal.getItem(5) threw exception IndexSizeError: Failed to execut
e 'getItem' on 'SVGLengthList': The index provided (5) is greater than or equal
to the maximum bound (5).. | |
46 | |
47 Assure that previously saved wrappers still show the old values | |
48 PASS item0.value is 500 | |
49 PASS item1.value is 1000 | |
50 PASS item2.value is 1500 | |
51 PASS item3.value is 50 | |
52 | |
53 Insert item 'newLength3' at position=2, between '500' and '1000' | |
54 PASS text1.x.baseVal.insertItemBefore(newLength3, 2) is newLength3 | |
55 PASS text1.x.baseVal.numberOfItems is 6 | |
56 PASS text1.x.baseVal.getItem(0).value is 100 | |
57 PASS text1.x.baseVal.getItem(1).value is 500 | |
58 PASS text1.x.baseVal.getItem(2).value is 150 | |
59 PASS text1.x.baseVal.getItem(3).value is 1000 | |
60 PASS text1.x.baseVal.getItem(4).value is 1500 | |
61 PASS text1.x.baseVal.getItem(5).value is 50 | |
62 PASS text1.x.baseVal.getItem(6) threw exception IndexSizeError: Failed to execut
e 'getItem' on 'SVGLengthList': The index provided (6) is greater than or equal
to the maximum bound (6).. | |
63 | |
64 Insert item 'newLength3' at position=1, between '100' and '500', should not remo
ve it from the old position=2 afterwards. | |
65 PASS text1.x.baseVal.insertItemBefore(newLength3, 1) is newLength3 | |
66 PASS text1.x.baseVal.numberOfItems is 7 | |
67 PASS text1.x.baseVal.getItem(0).value is 100 | |
68 PASS text1.x.baseVal.getItem(1).value is 150 | |
69 PASS text1.x.baseVal.getItem(2).value is 500 | |
70 PASS text1.x.baseVal.getItem(3).value is 150 | |
71 PASS text1.x.baseVal.getItem(4).value is 1000 | |
72 PASS text1.x.baseVal.getItem(5).value is 1500 | |
73 PASS text1.x.baseVal.getItem(6).value is 50 | |
74 PASS text1.x.baseVal.getItem(7) threw exception IndexSizeError: Failed to execut
e 'getItem' on 'SVGLengthList': The index provided (7) is greater than or equal
to the maximum bound (7).. | |
75 | |
76 Insert item 'newLength1' at position=0, before '100', should not remove it from
the old position=6 afterwards. | |
77 PASS text1.x.baseVal.insertItemBefore(newLength1, 0) is newLength1 | |
78 PASS text1.x.baseVal.numberOfItems is 8 | |
79 PASS text1.x.baseVal.getItem(0).value is 50 | |
80 PASS text1.x.baseVal.getItem(1).value is 100 | |
81 PASS text1.x.baseVal.getItem(2).value is 150 | |
82 PASS text1.x.baseVal.getItem(3).value is 500 | |
83 PASS text1.x.baseVal.getItem(4).value is 150 | |
84 PASS text1.x.baseVal.getItem(5).value is 1000 | |
85 PASS text1.x.baseVal.getItem(6).value is 1500 | |
86 PASS text1.x.baseVal.getItem(7).value is 50 | |
87 PASS text1.x.baseVal.getItem(8) threw exception IndexSizeError: Failed to execut
e 'getItem' on 'SVGLengthList': The index provided (8) is greater than or equal
to the maximum bound (8).. | |
88 | |
89 The test passes if you only see 'PASS' messages, and both text elements on top l
ook the same | |
90 | |
91 PASS successfullyParsed is true | |
92 | |
93 TEST COMPLETE | |
94 | |
OLD | NEW |