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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/number/number-stepup-stepdown.html

Issue 2452743004: INPUT element: Fix integer overflow in input.stepDown(). (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <script> 7 <script>
8 description('Check stepUp() and stepDown() behavior for number type.'); 8 description('Check stepUp() and stepDown() behavior for number type.');
9 9
10 var input = document.createElement('input'); 10 var input = document.createElement('input');
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 shouldBe('stepDown("0", null, null, "foo")', '"0"'); 66 shouldBe('stepDown("0", null, null, "foo")', '"0"');
67 shouldBe('stepUp("0", null, null, null)', '"0"'); 67 shouldBe('stepUp("0", null, null, null)', '"0"');
68 shouldBe('stepDown("0", null, null, null)', '"0"'); 68 shouldBe('stepDown("0", null, null, null)', '"0"');
69 debug('Normal cases'); 69 debug('Normal cases');
70 shouldBe('stepUp("0", null, null)', '"1"'); 70 shouldBe('stepUp("0", null, null)', '"1"');
71 shouldBe('stepUp("1", null, null, 2)', '"3"'); 71 shouldBe('stepUp("1", null, null, 2)', '"3"');
72 shouldBe('stepUp("3", null, null, -1)', '"2"'); 72 shouldBe('stepUp("3", null, null, -1)', '"2"');
73 shouldBe('stepDown("2", null, null)', '"1"'); 73 shouldBe('stepDown("2", null, null)', '"1"');
74 shouldBe('stepDown("1", null, null, 2)', '"-1"'); 74 shouldBe('stepDown("1", null, null, 2)', '"-1"');
75 shouldBe('stepDown("-1", null, null, -1)', '"0"'); 75 shouldBe('stepDown("-1", null, null, -1)', '"0"');
76 // According to Web IDL specification, 2147483648 here is converted to
77 // -2147483648. So, stepDown(2147483648) is equivalent to stepUp(2147483648).
78 shouldBeEqualToString('stepDown("0", "1", null, 2147483648)', '2147483648');
76 debug('Extra arguments'); 79 debug('Extra arguments');
77 shouldBe('input.value = "0"; input.min = null; input.step = null; input.stepUp(1 , 2); input.value', '"1"'); 80 shouldBe('input.value = "0"; input.min = null; input.step = null; input.stepUp(1 , 2); input.value', '"1"');
78 shouldBe('input.value = "1"; input.stepDown(1, 3); input.value', '"0"'); 81 shouldBe('input.value = "1"; input.stepDown(1, 3); input.value', '"0"');
79 debug('Invalid step value'); 82 debug('Invalid step value');
80 shouldBe('stepUp("0", "foo", null)', '"1"'); 83 shouldBe('stepUp("0", "foo", null)', '"1"');
81 shouldBe('stepUp("1", "0", null)', '"2"'); 84 shouldBe('stepUp("1", "0", null)', '"2"');
82 shouldBe('stepUp("2", "-1", null)', '"3"'); 85 shouldBe('stepUp("2", "-1", null)', '"3"');
83 debug('Step=any'); 86 debug('Step=any');
84 shouldThrow('stepUp("0", "any", null)'); 87 shouldThrow('stepUp("0", "any", null)');
85 shouldThrow('stepDown("0", "any", null)'); 88 shouldThrow('stepDown("0", "any", null)');
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 2)', '"5.015"'); 121 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 2)', '"5.015"');
119 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 11)', '"5.06"'); 122 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 11)', '"5.06"');
120 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 12)', '"5.065"'); 123 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 12)', '"5.065"');
121 124
122 debug(''); 125 debug('');
123 debug('This test should not dispatch any |change| events.'); 126 debug('This test should not dispatch any |change| events.');
124 shouldBe('changeEventCounter', '0'); 127 shouldBe('changeEventCounter', '0');
125 </script> 128 </script>
126 </body> 129 </body>
127 </html> 130 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/number/number-stepup-stepdown-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698