OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 description('Tests for .valueAsNumber with <input type=time>.'); | 10 description('Tests for .valueAsNumber with <input type=time>.'); |
(...skipping 21 matching lines...) Expand all Loading... |
32 shouldBe('setValueAsNumberAndGetValue(0, 0, 0, 2)', '"00:00:00.002"'); | 32 shouldBe('setValueAsNumberAndGetValue(0, 0, 0, 2)', '"00:00:00.002"'); |
33 shouldBe('setValueAsNumberAndGetValue(11, 59, 59, 999)', '"11:59:59.999"'); | 33 shouldBe('setValueAsNumberAndGetValue(11, 59, 59, 999)', '"11:59:59.999"'); |
34 shouldBe('setValueAsNumberAndGetValue(12, 0, 0, 0)', '"12:00"'); | 34 shouldBe('setValueAsNumberAndGetValue(12, 0, 0, 0)', '"12:00"'); |
35 shouldBe('setValueAsNumberAndGetValue(23, 59, 59, 999)', '"23:59:59.999"'); | 35 shouldBe('setValueAsNumberAndGetValue(23, 59, 59, 999)', '"23:59:59.999"'); |
36 shouldBe('setValueAsNumberAndGetValue(24, 0, 0, 0)', '"00:00"'); | 36 shouldBe('setValueAsNumberAndGetValue(24, 0, 0, 0)', '"00:00"'); |
37 shouldBe('setValueAsNumberAndGetValue(48, 0, 13, 0)', '"00:00:13"'); | 37 shouldBe('setValueAsNumberAndGetValue(48, 0, 13, 0)', '"00:00:13"'); |
38 shouldBe('setValueAsNumberAndGetValue(-23, -59, -59, 0)', '"00:00:01"'); | 38 shouldBe('setValueAsNumberAndGetValue(-23, -59, -59, 0)', '"00:00:01"'); |
39 | 39 |
40 debug('Tests to set invalid values to valueAsNumber:'); | 40 debug('Tests to set invalid values to valueAsNumber:'); |
41 shouldBe('input.value = ""; input.valueAsNumber = null; input.value', '"00:00"')
; | 41 shouldBe('input.value = ""; input.valueAsNumber = null; input.value', '"00:00"')
; |
42 shouldThrow('input.valueAsNumber = "foo"', '"Error: NotSupportedError: DOM Excep
tion 9"'); | 42 shouldThrow('input.valueAsNumber = "foo"', '"NotSupportedError: The implementati
on did not support the requested type of object or operation."'); |
43 shouldThrow('input.valueAsNumber = NaN', '"Error: NotSupportedError: DOM Excepti
on 9"'); | 43 shouldThrow('input.valueAsNumber = NaN', '"NotSupportedError: The implementation
did not support the requested type of object or operation."'); |
44 shouldThrow('input.valueAsNumber = Number.NaN', '"Error: NotSupportedError: DOM
Exception 9"'); | 44 shouldThrow('input.valueAsNumber = Number.NaN', '"NotSupportedError: The impleme
ntation did not support the requested type of object or operation."'); |
45 shouldThrow('input.valueAsNumber = Infinity', '"Error: NotSupportedError: DOM Ex
ception 9"'); | 45 shouldThrow('input.valueAsNumber = Infinity', '"NotSupportedError: The implement
ation did not support the requested type of object or operation."'); |
46 shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NotSuppor
tedError: DOM Exception 9"'); | 46 shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"NotSupportedErro
r: The implementation did not support the requested type of object or operation.
"'); |
47 shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NotSuppor
tedError: DOM Exception 9"'); | 47 shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"NotSupportedErro
r: The implementation did not support the requested type of object or operation.
"'); |
48 | 48 |
49 debug('Step attribute value and string representation:'); | 49 debug('Step attribute value and string representation:'); |
50 // If the step attribute value is 1 second and the second part is 0, we should s
how the second part. | 50 // If the step attribute value is 1 second and the second part is 0, we should s
how the second part. |
51 shouldBe('input.step = "1"; setValueAsNumberAndGetValue(0, 0, 0, 0)', '"00:00:00
"'); | 51 shouldBe('input.step = "1"; setValueAsNumberAndGetValue(0, 0, 0, 0)', '"00:00:00
"'); |
52 // If the step attribute value is 0.001 second and the millisecond part is 0, we
should show the millisecond part. | 52 // If the step attribute value is 0.001 second and the millisecond part is 0, we
should show the millisecond part. |
53 shouldBe('input.step = "0.001"; setValueAsNumberAndGetValue(0, 0, 0, 0)', '"00:0
0:00.000"'); | 53 shouldBe('input.step = "0.001"; setValueAsNumberAndGetValue(0, 0, 0, 0)', '"00:0
0:00.000"'); |
54 </script> | 54 </script> |
55 <script src="../../js/resources/js-test-post.js"></script> | 55 <script src="../../js/resources/js-test-post.js"></script> |
56 </body> | 56 </body> |
57 </html> | 57 </html> |
OLD | NEW |