blob: d45a9940a3439706b0da5c8bf1ec1b28167e6dab [file] [log] [blame]
ABC
ABC
ABC
This is a test of the SVGLengthList::appendItem() API.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Create a new SVGLength object, with value=150
PASS newLength1.value is 150
Check initial list state of text1
PASS text1.x.baseVal.numberOfItems is 5
PASS text1.x.baseVal.getItem(0).value is 500
PASS text1.x.baseVal.getItem(1).value is 50
PASS text1.x.baseVal.getItem(2).value is 100
PASS text1.x.baseVal.getItem(3).value is 900
PASS text1.x.baseVal.getItem(4).value is 1000
PASS text1.x.baseVal.getItem(5) threw exception IndexSizeError: The index is not in the allowed range..
Check initial list state of text2
PASS text2.x.baseVal.numberOfItems is 3
PASS text2.x.baseVal.getItem(0).value is 50
PASS text2.x.baseVal.getItem(1).value is 100
PASS text2.x.baseVal.getItem(2).value is 1000
PASS text2.x.baseVal.getItem(3) threw exception IndexSizeError: The index is not in the allowed range..
Append fourth item x=900 to the text1 x list
PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3)) is text1.x.baseVal.getItem(4)
PASS text1.x.baseVal.numberOfItems is 5
PASS text1.x.baseVal.getItem(0).value is 500
PASS text1.x.baseVal.getItem(1).value is 50
PASS text1.x.baseVal.getItem(2).value is 100
PASS text1.x.baseVal.getItem(3).value is 1000
PASS text1.x.baseVal.getItem(4).value is 900
PASS text1.x.baseVal.getItem(5) threw exception IndexSizeError: The index is not in the allowed range..
Append first item x=500 to the text1 x list
PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0)) is text1.x.baseVal.getItem(4)
PASS text1.x.baseVal.numberOfItems is 5
PASS text1.x.baseVal.getItem(0).value is 50
PASS text1.x.baseVal.getItem(1).value is 100
PASS text1.x.baseVal.getItem(2).value is 1000
PASS text1.x.baseVal.getItem(3).value is 900
PASS text1.x.baseVal.getItem(4).value is 500
PASS text1.x.baseVal.getItem(5) threw exception IndexSizeError: The index is not in the allowed range..
Append 'newLength1' to the text1 x list
PASS text1.x.baseVal.appendItem(newLength1) is text1.x.baseVal.getItem(5)
PASS text1.x.baseVal.numberOfItems is 6
PASS text1.x.baseVal.getItem(0).value is 50
PASS text1.x.baseVal.getItem(1).value is 100
PASS text1.x.baseVal.getItem(2).value is 1000
PASS text1.x.baseVal.getItem(3).value is 900
PASS text1.x.baseVal.getItem(4).value is 500
PASS text1.x.baseVal.getItem(5).value is 150
PASS text1.x.baseVal.getItem(6) threw exception IndexSizeError: The index is not in the allowed range..
Append third and fourth item of the text1 x list to the text2 x list
PASS text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 1000
PASS text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 900
PASS text1.x.baseVal.numberOfItems is 4
PASS text1.x.baseVal.getItem(0).value is 50
PASS text1.x.baseVal.getItem(1).value is 100
PASS text1.x.baseVal.getItem(2).value is 500
PASS text1.x.baseVal.getItem(3).value is 150
PASS text1.x.baseVal.getItem(4) threw exception IndexSizeError: The index is not in the allowed range..
PASS text2.x.baseVal.numberOfItems is 5
PASS text2.x.baseVal.getItem(0).value is 50
PASS text2.x.baseVal.getItem(1).value is 100
PASS text2.x.baseVal.getItem(2).value is 1000
PASS text2.x.baseVal.getItem(3).value is 1000
PASS text2.x.baseVal.getItem(4).value is 900
PASS text2.x.baseVal.getItem(5) threw exception IndexSizeError: The index is not in the allowed range..
PASS newLength2.value is 150
Shuffle around items in text1 and text2 list using appendItem, to get x=50,100,150,... in both lists
PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 500
PASS text2.x.baseVal.appendItem(newLength2).value is 150
PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value is 1000
PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(3)).value is 900
PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value is 1000
PASS text1.x.baseVal.numberOfItems is 4
PASS text1.x.baseVal.getItem(0).value is 50
PASS text1.x.baseVal.getItem(1).value is 100
PASS text1.x.baseVal.getItem(2).value is 150
PASS text1.x.baseVal.getItem(3).value is 500
PASS text1.x.baseVal.getItem(4) threw exception IndexSizeError: The index is not in the allowed range..
PASS text2.x.baseVal.numberOfItems is 6
PASS text2.x.baseVal.getItem(0).value is 50
PASS text2.x.baseVal.getItem(1).value is 100
PASS text2.x.baseVal.getItem(2).value is 150
PASS text2.x.baseVal.getItem(3).value is 1000
PASS text2.x.baseVal.getItem(4).value is 900
PASS text2.x.baseVal.getItem(5).value is 1000
PASS text2.x.baseVal.getItem(6) threw exception IndexSizeError: The index is not in the allowed range..
The test passes if you only see 'PASS' messages, and all three text elements on top look the same
PASS successfullyParsed is true
TEST COMPLETE