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

Unified Diff: LayoutTests/fast/forms/number/number-stepup-stepdown.html

Issue 136783006: Upgrade stepUp()/stepDown() implementation to match spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: applyStep(): add missing EventQueueScope Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/forms/number/number-stepup-stepdown.html
diff --git a/LayoutTests/fast/forms/number/number-stepup-stepdown.html b/LayoutTests/fast/forms/number/number-stepup-stepdown.html
index c45e6dada733a57c89898b45e2b74137b0838538..0def974eccfe7d018e1d3b4cd82e99d030e146ea 100644
--- a/LayoutTests/fast/forms/number/number-stepup-stepdown.html
+++ b/LayoutTests/fast/forms/number/number-stepup-stepdown.html
@@ -5,7 +5,7 @@
</head>
<body>
<script>
-description('Check stepUp() and stepDown() bahevior for number type.');
+description('Check stepUp() and stepDown() behavior for number type.');
var input = document.createElement('input');
@@ -55,8 +55,8 @@ function stepDownExplicitBounds(min, max, step, value, stepCount) {
debug('Number type');
input.type = 'number';
debug('Invalid value');
-shouldThrow('stepUp("", null, null)');
-shouldThrow('stepDown("", null, null)');
+shouldBeEqualToString('stepUp("", null, null)', '1');
+shouldBeEqualToString('stepDown("", null, null)', '-1');
debug('Non-number arguments');
shouldBe('stepUp("0", null, null, "0")', '"0"');
shouldBe('stepDown("0", null, null, "0")', '"0"');
@@ -86,21 +86,20 @@ shouldThrow('stepUpExplicitBounds("0", "100", "any", "1.5", "1")');
shouldThrow('stepDownExplicitBounds("0", "100", "any", "1.5", "1")');
debug('Overflow/underflow');
shouldBe('stepDown("1", "1", "0")', '"0"');
-shouldThrow('stepDown("0", "1", "0")');
-shouldThrow('stepDown("1", "1", "0", 2)');
-shouldBe('input.value', '"1"');
-shouldThrow('stepDown("1", "3.40282346e+38", "", 2)');
-shouldBe('stepUp("-1", "1", "0")', '"0"');
-shouldThrow('stepUp("0", "1", "0")');
-shouldThrow('stepUp("-1", "1", "0", 2)');
-shouldBe('input.value', '"-1"');
-shouldThrow('stepUp("1", "3.40282346e+38", "", 2)');
+shouldBeEqualToString('stepDown("0", "1", "0")', '0');
+shouldBeEqualToString('stepDown("1", "1", "0", 2)', '0');
+shouldBeEqualToString('stepDown("1", "3.40282346e+38", "", 2)', '-3.40282346e+38');
+shouldBeEqualToString('stepUp("-1", "1", "0")', '0');
+shouldBeEqualToString('stepUp("0", "1", "0")', '0');
+shouldBeEqualToString('stepUp("-1", "1", "0", 2)', '0');
+shouldBeEqualToString('stepUp("1", "3.40282346e+38", "", 2)', '3.40282346e+38');
debug('stepDown()/stepUp() for stepMismatch values');
-shouldBe('stepUp("1", "2", "")', '"3"');
-shouldBe('input.stepDown(); input.value', '"1"');
-shouldBe('input.min = "0"; stepUp("9", "10", "", 9)', '"99"');
-shouldBe('stepDown("19", "10", "0")', '"9"');
-shouldBe('stepUp("89", "10", "99")', '"99"');
+shouldBeEqualToString('stepUpExplicitBounds("0", "", "2", "1"); input.value', '2');
+shouldBeEqualToString('stepUp("1", "2", "")', '2');
+shouldBeEqualToString('input.stepDown(); input.value', '0');
+shouldBeEqualToString('input.min = "0"; stepUp("9", "10", "", 9)', '90');
+shouldBeEqualToString('stepDown("19", "10", "0")', '10');
+shouldBeEqualToString('stepUp("89", "10", "99")', '90');
debug('Huge value and small step');
shouldBe('input.min = ""; stepUp("1e+38", "1", "", 999999)', '"1e+38"');
shouldBe('input.max = ""; stepDown("1e+38", "1", "", 999999)', '"1e+38"');

Powered by Google App Engine
This is Rietveld 408576698