blob: 5dc794c552000c401e404516d2d859375d10f580 [file] [log] [blame]
Test select.options.add() with optgroup and with index parameter
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Call HTMLOptionsCollection.add() with zero arguments:
PASS testAdd() threw exception TypeError: Not enough arguments.
Call HTMLOptionsCollection.add() with only one argument:
PASS testAdd(createOption("Y9")) is "0,1,2,Y9"
PASS testAdd("foo") threw exception TypeError: Type error.
PASS testAdd(undefined) threw exception TypeError: Type error.
PASS testAdd(null) threw exception TypeError: Type error.
Call HTMLOptionsCollection.add() with two arguments:
PASS testAdd(createGroup("Y1", "Y2"), null) is "0,1,2,Y1,Y2"
PASS testAdd(createGroup("Y3", "Y4"), 0) is "Y3,Y4,0,1,2"
PASS testAdd(createGroup("Y5", "Y6"), 2) is "0,1,Y5,Y6,2"
PASS testAdd(createGroup("Y7", "Y8")) is "0,1,2,Y7,Y8"
PASS testAddWithoutResettingListOptions(createOption("Y10"), mySelect.options[2]) is "0,1,Y10,2"
PASS testAdd(createOption("Y11"), mySelect.options[1]) is "0,Y11,1,Y10,2"
PASS testAddWithoutResettingListOptions(createGroup("Y12", "Y13"), mySelect.options[1]) is "0,Y12,Y13,1,2"
PASS testAdd(createGroup("Y14", "Y15"), mySelect.options[3]) is "0,Y12,Y13,Y14,Y15,1,2"
PASS testAdd(createOption("Y16"), createOption("Y17")) threw exception NotFoundError: The object can not be found here..
PASS testAdd(createOption("Y1")) is "0,1,2,Y1"
PASS testAdd(createOption("Y2"), null) is "0,1,2,Y2"
PASS testAdd(createOption("Y3"), 0) is "Y3,0,1,2"
PASS testAdd(createOption("Y4"), 1) is "0,Y4,1,2"
PASS testAdd(createOption("Y5"), 2) is "0,1,Y5,2"
PASS testAdd(createOption("Y6"), 3) is "0,1,2,Y6"
PASS testAdd(createOption("Y7"), 100) is "0,1,2,Y7"
PASS testAdd(createOption("Y8"), -100) is "0,1,2,Y8"
PASS testAdd(createOption("Y9"), "0") is "Y9,0,1,2"
PASS testAdd(createOption("Y10"), "1") is "0,Y10,1,2"
PASS testAdd(createOption("Y11"), "2") is "0,1,Y11,2"
PASS testAdd(createOption("Y12"), true) is "0,Y12,1,2"
PASS testAdd(createOption("Y13"), false) is "Y13,0,1,2"
PASS testAdd(createOption("Y14"), 2147483647) is "0,1,2,Y14"
PASS testAdd(createOption("Y15"), 2147483648) is "0,1,2,Y15"
PASS testAdd(createOption("Y16"), -2147483647) is "0,1,2,Y16"
PASS testAdd(createOption("Y17"), -2147483648) is "0,1,2,Y17"
PASS testAdd(createOption("Y18"), -2147483649) is "0,1,2,Y18"
PASS testAdd(createOption("Y19"), Infinity) is "Y19,0,1,2"
PASS testAdd(createOption("Y20"), -Infinity) is "Y20,0,1,2"
PASS testAdd(createOption("Y21"), "foo") is "Y21,0,1,2"
PASS testAdd(createOption("Y22"), NaN) is "Y22,0,1,2"
PASS testAdd(createOption("Y23"), undefined) is "0,1,2,Y23"
PASS testAdd(createOption("Y24"), -2) is "0,1,2,Y24"
PASS testAdd(createOption("X"), mySelect.options[0]) is "X,0,1,2"
PASS testAdd(createOption("X"), mySelect.options[1]) is "0,X,1,2"
PASS testAdd(createOption("X"), mySelect.options[2]) is "0,1,X,2"
PASS testAdd(createOption("Y25"), 0, 1) is "Y25,0,1,2"
PASS testAdd(createOption("Y25"), mySelect.options[0], 1) is "Y25,0,1,2"
PASS testAdd("foo", 0) threw exception TypeError: Type error.
PASS testAdd(undefined, 0) threw exception TypeError: Type error.
PASS testAdd(null, 0) threw exception TypeError: Type error.
Call HTMLOptionsCollection.add() with three arguments (when it only takes two arguments):
PASS testAdd(createOption("X"), 0, "unnecessary extra argument - should be ignored") is "X,0,1,2"
PASS testAdd(createOption("X"), mySelect.options[1], "unnecessary extra argument - should be ignored") is "0,X,1,2"
PASS testAdd(createGroup("G1", "G2"), 1, "unnecessary extra argument - should be ignored") is "0,G1,G2,1,2"
PASS successfullyParsed is true
TEST COMPLETE