blob: dff5917960dddfefd7541df3d8053f4ad9b58d7c [file] [log] [blame]
This test checks the behavior of the remove() method on the select.options object.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
1.1 Remove (object) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.2 Remove (string) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.3 Remove (float) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.4 Remove (boolean) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.5 Remove (undefined) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.6 Remove (null) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.7 Remove (negative infinity) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.8 Remove (NaN) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.9 Remove (positive infinity) from empty Options
PASS select1.options.remove(value) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.10 Remove no args from empty Options
PASS select1.options.remove() threw exception TypeError: Failed to execute 'remove' on 'HTMLOptionsCollection': 1 argument required, but only 0 present..
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.11 Remove too many args from empty Options
PASS select1.options.remove(0, 'foo') is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.12 Remove invalid index -2 from empty Options
PASS select1.options.remove(-2) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.13 Remove invalid index -1 from empty Options
PASS select1.options.remove(-1) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.14 Remove index 0 from empty Options
PASS select1.options.remove(0) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.15 Remove index 1 from empty Options
PASS select1.options.remove(1) is undefined
PASS select1.options.length is 0
PASS select1.selectedIndex is -1
1.16 Detach select element
PASS select1.parentNode is not null
PASS select1.remove() is undefined
PASS select1.parentNode is null
2.1 Remove (object) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 15
PASS select2.selectedIndex is 13
PASS select2.options[0].value is 'B'
2.2 Remove (string) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 14
PASS select2.selectedIndex is 12
PASS select2.options[0].value is 'C'
2.3 Remove (float) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 13
PASS select2.selectedIndex is 11
PASS select2.options[3].value is 'G'
2.4 Remove (boolean true) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 12
PASS select2.selectedIndex is 10
PASS select2.options[1].value is 'E'
2.5 Remove (boolean false) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 11
PASS select2.selectedIndex is 9
PASS select2.options[1].value is 'G'
2.6 Remove (undefined) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 10
PASS select2.selectedIndex is 8
PASS select2.options[0].value is 'G'
2.7 Remove (null) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 9
PASS select2.selectedIndex is 7
PASS select2.options[0].value is 'H'
2.8 Remove (negative infinity) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 8
PASS select2.selectedIndex is 6
PASS select2.options[0].value is 'I'
2.9 Remove (NaN) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 7
PASS select2.selectedIndex is 5
PASS select2.options[0].value is 'J'
2.10 Remove (positive infinity) from non-empty Options
PASS select2.options.remove(value) is undefined
PASS select2.options.length is 6
PASS select2.selectedIndex is 4
PASS select2.options[0].value is 'K'
2.11 Remove no args from non-empty Options
PASS select2.options.remove() threw exception TypeError: Failed to execute 'remove' on 'HTMLOptionsCollection': 1 argument required, but only 0 present..
PASS select2.options.length is 6
PASS select2.selectedIndex is 4
PASS select2.options[0].value is 'K'
2.12 Remove too many args from non-empty Options
PASS select2.options.remove(0, 'foo') is undefined
PASS select2.options.length is 5
PASS select2.selectedIndex is 3
PASS select2.options[0].value is 'L'
2.13 Remove invalid index -2 from non-empty Options
PASS select2.options.remove(-2) is undefined
PASS select2.options.length is 5
PASS select2.selectedIndex is 3
PASS select2.options[2].value is 'N'
2.14 Remove invalid index -1 from non-empty Options
PASS select2.options.remove(-1) is undefined
PASS select2.options.length is 5
PASS select2.selectedIndex is 3
PASS select2.options[3].value is 'O'
2.15 Remove index 0 from non-empty Options
PASS select2.options.remove(0) is undefined
PASS select2.options.length is 4
PASS select2.selectedIndex is 2
PASS select2.options[0].value is 'M'
2.16 Remove index 1 from non-empty Options
PASS select2.options.remove(1) is undefined
PASS select2.options.length is 3
PASS select2.selectedIndex is 1
PASS select2.options[1].value is 'O'
2.17 Detach select element
PASS select2.parentNode is not null
PASS select2.remove() is undefined
PASS select2.parentNode is null
PASS successfullyParsed is true
TEST COMPLETE