| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 description('Tests for .valueAsNumber with <input type=number>.'); | 8 description('Tests for .valueAsNumber with <input type=number>.'); |
| 9 | 9 |
| 10 var input = document.createElement('input'); | 10 var input = document.createElement('input'); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 shouldBe('setValueAsNumberAndGetValue(1.2e10)', '"12000000000"'); | 61 shouldBe('setValueAsNumberAndGetValue(1.2e10)', '"12000000000"'); |
| 62 shouldBe('setValueAsNumberAndGetValue(1.2e-10)', '"1.2e-10"'); | 62 shouldBe('setValueAsNumberAndGetValue(1.2e-10)', '"1.2e-10"'); |
| 63 shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+38)', '"1.234567890123
4567e+38"'); | 63 shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+38)', '"1.234567890123
4567e+38"'); |
| 64 shouldBe('setValueAsNumberAndGetValue("-3.40282346e+38")', '"-3.40282346e+38"'); | 64 shouldBe('setValueAsNumberAndGetValue("-3.40282346e+38")', '"-3.40282346e+38"'); |
| 65 shouldThrow('setValueAsNumberAndGetValue("-3.40282348e+38")', '"InvalidStateErro
r: An attempt was made to use an object that is not, or is no longer, usable."')
; | 65 shouldThrow('setValueAsNumberAndGetValue("-3.40282348e+38")', '"InvalidStateErro
r: An attempt was made to use an object that is not, or is no longer, usable."')
; |
| 66 shouldBe('setValueAsNumberAndGetValue("3.40282346e+38")', '"3.40282346e+38"'); | 66 shouldBe('setValueAsNumberAndGetValue("3.40282346e+38")', '"3.40282346e+38"'); |
| 67 shouldThrow('setValueAsNumberAndGetValue("3.40282348e+38")', '"InvalidStateError
: An attempt was made to use an object that is not, or is no longer, usable."'); | 67 shouldThrow('setValueAsNumberAndGetValue("3.40282348e+38")', '"InvalidStateError
: An attempt was made to use an object that is not, or is no longer, usable."'); |
| 68 | 68 |
| 69 debug('Tests to set invalid values to valueAsNumber:'); | 69 debug('Tests to set invalid values to valueAsNumber:'); |
| 70 shouldBe('setValueAsNumberAndGetValue(null)', '"0"'); | 70 shouldBe('setValueAsNumberAndGetValue(null)', '"0"'); |
| 71 shouldThrow('setValueAsNumberAndGetValue("foo")', '"NotSupportedError: The imple
mentation did not support the requested type of object or operation."'); | 71 shouldThrow('setValueAsNumberAndGetValue("foo")', '"NotSupportedError: Failed to
set the \'valueAsNumber\' property on \'HTMLInputElement\': The value provided
is not a number."'); |
| 72 shouldThrow('setValueAsNumberAndGetValue(NaN)', '"NotSupportedError: The impleme
ntation did not support the requested type of object or operation."'); | 72 shouldThrow('setValueAsNumberAndGetValue(NaN)', '"NotSupportedError: Failed to s
et the \'valueAsNumber\' property on \'HTMLInputElement\': The value provided is
not a number."'); |
| 73 shouldThrow('setValueAsNumberAndGetValue(Number.NaN)', '"NotSupportedError: The
implementation did not support the requested type of object or operation."'); | 73 shouldThrow('setValueAsNumberAndGetValue(Number.NaN)', '"NotSupportedError: Fail
ed to set the \'valueAsNumber\' property on \'HTMLInputElement\': The value prov
ided is not a number."'); |
| 74 shouldThrow('setValueAsNumberAndGetValue(Infinity)', '"NotSupportedError: The im
plementation did not support the requested type of object or operation."'); | 74 shouldThrow('setValueAsNumberAndGetValue(Infinity)', '"NotSupportedError: Failed
to set the \'valueAsNumber\' property on \'HTMLInputElement\': The value provid
ed is infinite."'); |
| 75 shouldThrow('setValueAsNumberAndGetValue(Number.POSITIVE_INFINITY)', '"NotSuppor
tedError: The implementation did not support the requested type of object or ope
ration."'); | 75 shouldThrow('setValueAsNumberAndGetValue(Number.POSITIVE_INFINITY)', '"NotSuppor
tedError: Failed to set the \'valueAsNumber\' property on \'HTMLInputElement\':
The value provided is infinite."'); |
| 76 shouldThrow('setValueAsNumberAndGetValue(Number.NEGATIVE_INFINITY)', '"NotSuppor
tedError: The implementation did not support the requested type of object or ope
ration."'); | 76 shouldThrow('setValueAsNumberAndGetValue(Number.NEGATIVE_INFINITY)', '"NotSuppor
tedError: Failed to set the \'valueAsNumber\' property on \'HTMLInputElement\':
The value provided is infinite."'); |
| 77 </script> | 77 </script> |
| 78 </body> | 78 </body> |
| 79 </html> | 79 </html> |
| OLD | NEW |