blob: 71cfadbd0fdb201fd6103cce70d46a7d8ce3e56f [file] [log] [blame]
Test setting valid and invalid properties of HTMLProgressElement.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Test values before properties were set
PASS p.value is 0
PASS p.max is 1
PASS p.position is -1
Set valid values
PASS p.value is 70
PASS p.max is 100
PASS p.position is 0.7
Set value bigger than max
PASS p.value is 100
PASS p.max is 100
PASS p.position is 1
Set value less than zero
PASS p.value is 0
PASS p.position is 0
Set invalid value, should throw
PASS p.value = "200A"; threw exception TypeError: The provided value is non-finite.
Set invalid max, should throw
PASS p.max = "max"; threw exception TypeError: The provided value is non-finite.
Set max to Infinity, should throw
PASS p.max = Infinity; threw exception TypeError: The provided value is non-finite.
Set value to NaN, should throw
PASS p.value = NaN; threw exception TypeError: The provided value is non-finite.
Set value to null and max to 0
PASS p.value is 0
PASS p.max is 100
PASS p.position is 0
Set attributes to valid numbers
PASS p.value is 5
PASS p.max is 10
PASS parseInt(p.getAttribute('value')) is 5
PASS parseInt(p.getAttribute('max')) is 10
Set attributes to invalid values
PASS p.value is 0
PASS p.max is 1
PASS p.getAttribute('value') is 'ABC'
PASS p.getAttribute('max') is '#'
Set value and max to numbers with leading spaces
PASS p.value is 0
PASS p.max is 1
PASS p.position is 0
PASS successfullyParsed is true
TEST COMPLETE