blob: 733522cf27f2375d6db10f99e88ba66911966cf9 [file] [log] [blame]
This is a test of the simple SVGPointList API parts.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
Creating point x=200 y=100
PASS (point = svg.createSVGPoint()).toString() is "[object SVGPoint]"
PASS point.x = 200 is 200
PASS point.y = 100 is 100
Test uncommon arguments for initialize()
PASS poly1.points.initialize(point) is point
PASS poly1.points.numberOfItems is 1
PASS dumpPoint(poly1.points.getItem(0)) is "x=200 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "200 100"
PASS poly1.points.initialize(poly1) threw exception TypeError: Failed to execute 'initialize' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
PASS poly1.points.initialize(0) threw exception TypeError: Failed to execute 'initialize' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
PASS poly1.points.initialize('aString') threw exception TypeError: Failed to execute 'initialize' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
Reset points attribute to 0 0 100 0 100 100 0 100
PASS poly1.setAttribute('points', '0 0 100 0 100 100 0 100') is undefined.
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
Test uncommon arguments for getItem()
PASS poly1.points.getItem(30) threw exception IndexSizeError: Index or size was negative, or greater than the allowed value..
PASS poly1.points.getItem('aString') is poly1.points.getItem(0)
PASS poly1.points.getItem(poly1) is poly1.points.getItem(0)
PASS poly1.points.getItem(null) is poly1.points.getItem(0)
Test uncommon arguments for insertItemBefore()
PASS poly1.points.insertItemBefore(30) threw exception TypeError: Failed to execute 'insertItemBefore' on 'SVGPointList': 2 arguments required, but only 1 present..
PASS poly1.points.insertItemBefore('aString') threw exception TypeError: Failed to execute 'insertItemBefore' on 'SVGPointList': 2 arguments required, but only 1 present..
PASS poly1.points.insertItemBefore(poly1) threw exception TypeError: Failed to execute 'insertItemBefore' on 'SVGPointList': 2 arguments required, but only 1 present..
PASS poly1.points.insertItemBefore(null) threw exception TypeError: Failed to execute 'insertItemBefore' on 'SVGPointList': 2 arguments required, but only 1 present..
PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 'aString')) is "x=100 y=0"
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 0 0 100 100 0 100"
PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), poly1)) is "x=0 y=0"
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), null)) is "x=100 y=0"
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 0 0 100 100 0 100"
PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 0)) is "x=0 y=0"
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
PASS poly1.points.insertItemBefore(30, 0) threw exception TypeError: Failed to execute 'insertItemBefore' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
PASS poly1.points.insertItemBefore('aString', 0) threw exception TypeError: Failed to execute 'insertItemBefore' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
PASS poly1.points.insertItemBefore(poly1, 0) threw exception TypeError: Failed to execute 'insertItemBefore' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
PASS poly1.points.insertItemBefore(null, 0) threw exception TypeError: Failed to execute 'insertItemBefore' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
Test uncommon arguments for replaceItem()
PASS poly1.points.replaceItem(30) threw exception TypeError: Failed to execute 'replaceItem' on 'SVGPointList': 2 arguments required, but only 1 present..
PASS poly1.points.replaceItem('aString') threw exception TypeError: Failed to execute 'replaceItem' on 'SVGPointList': 2 arguments required, but only 1 present..
PASS poly1.points.replaceItem(poly1) threw exception TypeError: Failed to execute 'replaceItem' on 'SVGPointList': 2 arguments required, but only 1 present..
PASS poly1.points.replaceItem(null, 0) threw exception TypeError: Failed to execute 'replaceItem' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
PASS poly1.points.replaceItem('aString', 0) threw exception TypeError: Failed to execute 'replaceItem' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
PASS poly1.points.replaceItem(poly1, 0) threw exception TypeError: Failed to execute 'replaceItem' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
PASS poly1.points.replaceItem(1, 0) threw exception TypeError: Failed to execute 'replaceItem' on 'SVGPointList': parameter 1 is not of type 'SVGPoint'..
Test uncommon arguments for replaceItem() and xml-dom synchronization
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
PASS dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), 0)) is "x=0 y=0"
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
PASS dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), 'aString')) is "x=0 y=0"
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
PASS dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), poly1)) is "x=0 y=0"
PASS poly1.points.numberOfItems is 4
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100"
PASS dumpPoint(poly1.points.replaceItem(poly1.points.getItem(0), null)) is "x=0 y=0"
PASS poly1.points.numberOfItems is 4
PASS poly1.getAttribute('points') is "0 0 100 0 100 100 0 100"
Reset points attribute to 0 0 100 0 100 100 0 100
PASS poly1.setAttribute('points', '0 0 100 0 100 100 0 100') is undefined.
Test uncommon arguments for removeItem()
PASS poly1.points.removeItem(30) threw exception IndexSizeError: Failed to execute 'removeItem' on 'SVGPointList': The index provided (30) is greater than the maximum bound (4)..
PASS dumpPoint(poly1.points.removeItem('aString')) is "x=0 y=0"
PASS poly1.points.numberOfItems is 3
PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0"
PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0"
PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 100 100 0 100"
PASS dumpPoint(poly1.points.removeItem(poly1)) is "x=100 y=0"
PASS poly1.points.numberOfItems is 2
PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=100"
PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "100 100 0 100"
PASS dumpPoint(poly1.points.removeItem(null)) is "x=100 y=100"
PASS poly1.points.numberOfItems is 1
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 100"
Test uncommon arguments for appendItem()
PASS dumpPoint(poly1.points.appendItem(point)) is "x=200 y=100"
PASS poly1.points.numberOfItems is 2
PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=100"
PASS dumpPoint(poly1.points.getItem(1)) is "x=200 y=100"
PASS poly1.getAttribute('points').formatPointsAttribute() is "0 100 200 100"
PASS successfullyParsed is true
TEST COMPLETE