1 Check stepUp() and stepDown() behavior for number type.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
8 PASS stepUp("", null, null) is "1"
9 PASS stepDown("", null, null) is "-1"
11 PASS stepUp("0", null, null, "0") is "0"
12 PASS stepDown("0", null, null, "0") is "0"
13 PASS stepUp("0", null, null, "foo") is "0"
14 PASS stepDown("0", null, null, "foo") is "0"
15 PASS stepUp("0", null, null, null) is "0"
16 PASS stepDown("0", null, null, null) is "0"
18 PASS stepUp("0", null, null) is "1"
19 PASS stepUp("1", null, null, 2) is "3"
20 PASS stepUp("3", null, null, -1) is "2"
21 PASS stepDown("2", null, null) is "1"
22 PASS stepDown("1", null, null, 2) is "-1"
23 PASS stepDown("-1", null, null, -1) is "0"
25 PASS input.value = "0"; input.min = null; input.step = null; input.stepUp(1, 2); input.value is "1"
26 PASS input.value = "1"; input.stepDown(1, 3); input.value is "0"
28 PASS stepUp("0", "foo", null) is "1"
29 PASS stepUp("1", "0", null) is "2"
30 PASS stepUp("2", "-1", null) is "3"
32 PASS stepUp("0", "any", null) threw exception InvalidStateError: Failed to execute 'stepUp' on 'HTMLInputElement': This form element does not have an allowed value step..
33 PASS stepDown("0", "any", null) threw exception InvalidStateError: Failed to execute 'stepDown' on 'HTMLInputElement': This form element does not have an allowed value step..
35 PASS stepUpExplicitBounds("0", "100", "any", "1.5", "1") threw exception InvalidStateError: Failed to execute 'stepUp' on 'HTMLInputElement': This form element does not have an allowed value step..
36 PASS stepDownExplicitBounds("0", "100", "any", "1.5", "1") threw exception InvalidStateError: Failed to execute 'stepDown' on 'HTMLInputElement': This form element does not have an allowed value step..
38 PASS stepDown("1", "1", "0") is "0"
39 PASS stepDown("0", "1", "0") is "0"
40 PASS stepDown("1", "1", "0", 2) is "0"
41 PASS stepDown("1", "1.797693134862315e+308", "", 2) is "-1.797693134862315e+308"
42 PASS stepUp("-1", "1", "0") is "0"
43 PASS stepUp("0", "1", "0") is "0"
44 PASS stepUp("-1", "1", "0", 2) is "0"
45 PASS stepUp("1", "1.797693134862315e+308", "", 2) is "1.797693134862315e+308"
46 stepDown()/stepUp() for stepMismatch values
47 PASS stepUpExplicitBounds("0", "", "2", "1"); input.value is "2"
48 PASS stepUp("1", "2", "") is "2"
49 PASS input.stepDown(); input.value is "0"
50 PASS input.min = "0"; stepUp("9", "10", "", 9) is "90"
51 PASS stepDown("19", "10", "0") is "10"
52 PASS stepUp("89", "10", "99") is "90"
53 Huge value and small step
54 PASS input.min = ""; stepUp("1e+308", "1", "", 999999) is "1e+308"
55 PASS input.max = ""; stepDown("1e+308", "1", "", 999999) is "1e+308"
57 PASS input.min = ""; stepUp("0", "0.33333333333333333", "", 3) is "1"
58 PASS stepUp("1", "0.1", "", 10) is "2"
59 PASS input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value is "3"
60 PASS input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255) is "1"
61 PASS for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value is "0"
63 PASS stepUp("5.005", "0.005", "", 2) is "5.015"
64 PASS stepUp("5.005", "0.005", "", 11) is "5.06"
65 PASS stepUp("5.005", "0.005", "", 12) is "5.065"
66 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 2) is "5.015"
67 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 11) is "5.06"
68 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 12) is "5.065"
70 This test should not dispatch any |change| events.
71 PASS changeEventCounter is 0
72 PASS successfullyParsed is true