Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: LayoutTests/fast/forms/range/input-valueasnumber-range.html

Issue 84693008: Improve HTMLInputElement exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <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 &lt;input type=range>.'); 10 description('Tests for .valueAsNumber with &lt;input type=range>.');
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 shouldBe('setValueAsNumberAndGetValue(10)', '"10"'); 63 shouldBe('setValueAsNumberAndGetValue(10)', '"10"');
64 shouldBe('setValueAsNumberAndGetValue(01)', '"1"'); 64 shouldBe('setValueAsNumberAndGetValue(01)', '"1"');
65 shouldBe('setValueAsNumberAndGetValue(-0)', '"0"'); 65 shouldBe('setValueAsNumberAndGetValue(-0)', '"0"');
66 shouldBe('setValueAsNumberAndGetValue(-1.2)', '"0"'); 66 shouldBe('setValueAsNumberAndGetValue(-1.2)', '"0"');
67 shouldBe('setValueAsNumberAndGetValue(1.2e10)', '"100"'); 67 shouldBe('setValueAsNumberAndGetValue(1.2e10)', '"100"');
68 shouldBe('setValueAsNumberAndGetValue(1.2e-10)', '"0"'); 68 shouldBe('setValueAsNumberAndGetValue(1.2e-10)', '"0"');
69 shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+38)', '"100"'); 69 shouldBe('setValueAsNumberAndGetValue(1.2345678901234567e+38)', '"100"');
70 70
71 debug('Tests to set invalid values to valueAsNumber:'); 71 debug('Tests to set invalid values to valueAsNumber:');
72 shouldBe('setValueAsNumberAndGetValue(null)', '"0"'); 72 shouldBe('setValueAsNumberAndGetValue(null)', '"0"');
73 shouldThrow('setValueAsNumberAndGetValue("foo")', '"NotSupportedError: The imple mentation did not support the requested type of object or operation."'); 73 shouldThrow('setValueAsNumberAndGetValue("foo")', '"NotSupportedError: Failed to set the \'valueAsNumber\' property on \'HTMLInputElement\': The value provided is not a number."');
74 shouldThrow('setValueAsNumberAndGetValue(NaN)', '"NotSupportedError: The impleme ntation did not support the requested type of object or operation."'); 74 shouldThrow('setValueAsNumberAndGetValue(NaN)', '"NotSupportedError: Failed to s et the \'valueAsNumber\' property on \'HTMLInputElement\': The value provided is not a number."');
75 shouldThrow('setValueAsNumberAndGetValue(Number.NaN)', '"NotSupportedError: The implementation did not support the requested type of object or operation."'); 75 shouldThrow('setValueAsNumberAndGetValue(Number.NaN)', '"NotSupportedError: Fail ed to set the \'valueAsNumber\' property on \'HTMLInputElement\': The value prov ided is not a number."');
76 shouldThrow('setValueAsNumberAndGetValue(Infinity)', '"NotSupportedError: The im plementation did not support the requested type of object or operation."'); 76 shouldThrow('setValueAsNumberAndGetValue(Infinity)', '"NotSupportedError: Failed to set the \'valueAsNumber\' property on \'HTMLInputElement\': The value provid ed is infinite."');
77 shouldThrow('setValueAsNumberAndGetValue(Number.POSITIVE_INFINITY)', '"NotSuppor tedError: The implementation did not support the requested type of object or ope ration."'); 77 shouldThrow('setValueAsNumberAndGetValue(Number.POSITIVE_INFINITY)', '"NotSuppor tedError: Failed to set the \'valueAsNumber\' property on \'HTMLInputElement\': The value provided is infinite."');
78 shouldThrow('setValueAsNumberAndGetValue(Number.NEGATIVE_INFINITY)', '"NotSuppor tedError: The implementation did not support the requested type of object or ope ration."'); 78 shouldThrow('setValueAsNumberAndGetValue(Number.NEGATIVE_INFINITY)', '"NotSuppor tedError: Failed to set the \'valueAsNumber\' property on \'HTMLInputElement\': The value provided is infinite."');
79 </script> 79 </script>
80 </body> 80 </body>
81 </html> 81 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698