</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');
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"');
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"');