INPUT_MULTIPLE_FIELDS_UI: Step-up/-down of minute/second/millisecond fields should...
[WebKit-https.git] / LayoutTests / fast / forms / time-multiple-fields / time-multiple-fields-stepup-stepdown-from-renderer.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script>
5 <script src="../resources/common.js"></script>
6 </head>
7 <body>
8 <script>
9 description('Check stepping-up and -down for time input fields from renderer. No cases of empty initial values.');
10 if (!window.internals)
11     testFailed('This test requires window.internals.');
12
13 var input = document.createElement('input');
14 var invalidStateErr = '"Error: InvalidStateError: DOM Exception 11"';
15
16 document.body.appendChild(input);
17
18 function keyDown(key, modifiers)
19 {
20     if (!window.eventSender)
21         return;
22     eventSender.keyDown(key, modifiers);
23 }
24
25 function setDateTimeFormat(pattern) {
26     getElementByPseudoId(internals.youngestShadowRoot(input), '-webkit-datetime-edit').setAttribute('pattern', pattern);
27     input.value = '';  // Updates the element for new format
28 }
29
30 function setInputAttributes(value, min, max, step) {
31     input.value = value;
32     input.min = min;
33     input.max = max;
34     input.step = step;
35 }
36
37 function test(value, step, min, max, keySequence) {
38     setInputAttributes(value, min, max, step);
39     for (var i = 0; i < keySequence.length; i++)
40         keyDown(keySequence[i]);
41     return input.value;
42 }
43
44 function stepUp(value, step, min, max) {
45     return test(value, step, min, max, ['upArrow']);
46 }
47
48 function stepDown(value, step, min, max) {
49     return test(value, step, min, max, ['downArrow']);
50 }
51
52 input.type = 'time';
53 input.focus();
54 keyDown('rightArrow');
55 debug('Function arguments are (value, step, min, max, [keySequence]).');
56 debug('Normal cases');
57 shouldBeEqualToString('stepUp("07:13", null, null, null)', '07:14');
58 shouldBeEqualToString('stepDown("07:13", null, null, null)', '07:12');
59 shouldBeEqualToString('test("07:13", null, null, null, ["upArrow", "upArrow", "upArrow"])', '07:16');
60 shouldBeEqualToString('test("07:13", null, null, null, ["downArrow", "downArrow", "downArrow"])', '07:10');
61
62 debug('Milliseconds');
63 input.step = 0.001;
64 keyDown('rightArrow');
65 keyDown('rightArrow');
66 shouldBeEqualToString('stepUp("07:13:00.000", 0.001, null, null)', '07:13:00.001');
67 shouldBeEqualToString('stepDown("07:13:00.001", 0.001, null, null)', '07:13');
68 shouldBeEqualToString('stepUp("07:13:00.999", 0.001, null, null)', '07:13');
69 shouldBeEqualToString('stepDown("07:13:00.000", 0.001, null, null)', '07:13:00.999');
70 shouldBeEqualToString('stepUp("07:13:00.000", 0.250, null, null)', '07:13:00.250');
71 shouldBeEqualToString('stepDown("07:13:00.500", 0.250, null, null)', '07:13:00.250');
72 shouldBeEqualToString('stepUp("07:13:00.750", 0.250, null, null)', '07:13');
73 shouldBeEqualToString('stepDown("07:13:00.000", 0.250, null, null)', '07:13:00.750');
74 shouldBeEqualToString('stepUp("07:13:00.099", 0.100, null, null)', '07:13:00.100');
75 shouldBeEqualToString('stepDown("07:13:00.101", 0.100, null, null)', '07:13:00.100');
76 shouldBeEqualToString('stepUp("07:13:00.500", 0.0001, null, null)', '07:13:00.501');
77 shouldBeEqualToString('stepDown("07:13:00.500", 0.0001, null, null)', '07:13:00.499');
78 shouldBeEqualToString('stepUp("07:13:00.500", 0, null, null)', '07:13');
79 shouldBeEqualToString('stepDown("07:13:00.500", 0, null, null)', '07:13');
80 shouldBeEqualToString('stepUp("07:13:00.500", 60, null, null)', '07:13');
81 shouldBeEqualToString('stepDown("07:13:00.500", 60, null, null)', '07:13');
82 shouldBeEqualToString('stepUp("07:13:00.500", 0.100, "00:00:00.050", null)', '07:13:00.550');
83 shouldBeEqualToString('stepDown("07:13:00.500", 0.100, "00:00:00.050", null)', '07:13:00.450');
84 shouldBeEqualToString('test("07:13:00.500", 0.100, null, null, ["delete", "upArrow"])', '07:13');
85 shouldBeEqualToString('test("07:13:00.500", 0.100, null, null, ["delete", "downArrow"])', '07:13:00.900');
86 shouldBeEqualToString('test("07:13:00.500", 0.100, "00:00:00.050", null, ["delete", "upArrow"])', '07:13:00.050');
87 shouldBeEqualToString('test("07:13:00.500", 0.100, "00:00:00.050", null, ["delete", "downArrow"])', '07:13:00.950');
88 shouldBeEqualToString('stepUp("07:13:00.010", 0.001, "07:13:00.005", "07:13:00.010")', '07:13:00.005');
89 shouldBeEqualToString('stepDown("07:13:00.005", 0.001, "07:13:00.005", "07:13:00.010")', '07:13:00.010');
90 shouldBeEqualToString('stepUp("07:13:00.005", 0.001, "07:13:00.010", "07:13:00.020")', '07:13:00.010');
91 shouldBeEqualToString('stepDown("07:13:00.005", 0.001, "07:13:00.010", "07:13:00.020")', '07:13:00.020');
92 shouldBeEqualToString('stepUp("07:13:00.005", 0.001, "07:13:00.002", "07:13:00.002")', '07:13:00.002');
93 shouldBeEqualToString('stepDown("07:13:00.005", 0.001, "07:13:00.002", "07:13:00.002")', '07:13:00.002');
94 shouldBeEqualToString('stepUp("07:13:00.035", 0.01, "07:13:00.010", "07:13:00.035")', '07:13:00.010');
95 shouldBeEqualToString('stepDown("07:13:00.035", 0.01, "07:13:00.010", "07:13:00.035")', '07:13:00.030');
96 shouldBeEqualToString('stepUp("07:13:00.010", 0.001, "07:13:00.010", "07:13:01.020")', '07:13:00.011');
97 shouldBeEqualToString('stepDown("07:13:00.010", 0.001, "07:13:00.010", "07:13:01.020")', '07:13:00.009');
98
99 debug('Seconds');
100 keyDown('leftArrow');
101 shouldBeEqualToString('stepUp("07:13:00", 1, null, null)', '07:13:01');
102 shouldBeEqualToString('stepDown("07:13:01", 1, null, null)', '07:13');
103 shouldBeEqualToString('stepUp("07:13:59", 0.001, null, null)', '07:13');
104 shouldBeEqualToString('stepDown("07:13:00", 0.001, null, null)', '07:13:59');
105 shouldBeEqualToString('stepUp("07:13:00", 10, null, null)', '07:13:10');
106 shouldBeEqualToString('stepDown("07:13:30", 10, null, null)', '07:13:20');
107 shouldBeEqualToString('stepUp("07:13:50", 10, null, null)', '07:13');
108 shouldBeEqualToString('stepDown("07:13:00", 10, null, null)', '07:13:50');
109 shouldBeEqualToString('stepUp("07:13:09", 10, null, null)', '07:13:10');
110 shouldBeEqualToString('stepDown("07:13:11", 10, null, null)', '07:13:10');
111 shouldBeEqualToString('stepUp("07:13:30", 2.5, null, null)', '07:13:31');
112 shouldBeEqualToString('stepDown("07:13:30", 2.5, null, null)', '07:13:29');
113 shouldBeEqualToString('stepUp("07:13:30", 0, null, null)', '07:13');
114 shouldBeEqualToString('stepDown("07:13:30", 0, null, null)', '07:13');
115 shouldBeEqualToString('stepUp("07:13:30", 3600, null, null)', '07:13');
116 shouldBeEqualToString('stepDown("07:13:30", 3600, null, null)', '07:13');
117 shouldBeEqualToString('stepUp("07:13:30", 11, null, null)', '07:13:31');
118 shouldBeEqualToString('stepDown("07:13:30", 11, null, null)', '07:13:29');
119 shouldBeEqualToString('stepUp("07:13:30", 10, "00:00:05", null)', '07:13:35');
120 shouldBeEqualToString('stepDown("07:13:30", 10, "00:00:05", null)', '07:13:25');
121 shouldBeEqualToString('test("07:13:30", 10, null, null, ["delete", "upArrow"])', '07:13');
122 shouldBeEqualToString('test("07:13:30", 10, null, null, ["delete", "downArrow"])', '07:13:50');
123 shouldBeEqualToString('test("07:13:30", 10, "00:00:05", null, ["delete", "upArrow"])', '07:13:05');
124 shouldBeEqualToString('test("07:13:30", 10, "00:00:05", null, ["delete", "downArrow"])', '07:13:55');
125 shouldBeEqualToString('stepUp("07:13:10", 1, "07:13:05", "07:13:10")', '07:13:05');
126 shouldBeEqualToString('stepDown("07:13:05", 1, "07:13:05", "07:13:10")', '07:13:10');
127 shouldBeEqualToString('stepUp("07:13:05", 1, "07:13:10", "07:13:20")', '07:13:10');
128 shouldBeEqualToString('stepDown("07:13:05", 1, "07:13:10", "07:13:20")', '07:13:20');
129 shouldBeEqualToString('stepUp("07:13:05", 1, "07:13:02", "07:13:02")', '07:13:02');
130 shouldBeEqualToString('stepDown("07:13:05", 1, "07:13:02", "07:13:02")', '07:13:02');
131 shouldBeEqualToString('stepUp("07:13:35", 10, "07:13:10", "07:13:35")', '07:13:10');
132 shouldBeEqualToString('stepDown("07:13:35", 10, "07:13:10", "07:13:35")', '07:13:30');
133 shouldBeEqualToString('stepUp("07:13:10", 1, "07:13:10", "07:14:20")', '07:13:11');
134 shouldBeEqualToString('stepDown("07:13:10", 1, "07:13:10", "07:14:20")', '07:13:09');
135
136 debug('Minutes');
137 keyDown('leftArrow');
138 shouldBeEqualToString('stepUp("07:13", 1, null, null)', '07:14');
139 shouldBeEqualToString('stepDown("07:13", 1, null, null)', '07:12');
140 shouldBeEqualToString('stepUp("07:59", 0.001, null, null)', '07:00');
141 shouldBeEqualToString('stepDown("07:00", 0.001, null, null)', '07:59');
142 shouldBeEqualToString('stepUp("07:00", 600, null, null)', '07:10');
143 shouldBeEqualToString('stepDown("07:10", 600, null, null)', '07:00');
144 shouldBeEqualToString('stepUp("07:50", 600, null, null)', '07:00');
145 shouldBeEqualToString('stepDown("07:00", 600, null, null)', '07:50');
146 shouldBeEqualToString('stepUp("07:13", 600, null, null)', '07:20');
147 shouldBeEqualToString('stepDown("07:13", 600, null, null)', '07:10');
148 shouldBeEqualToString('stepUp("07:13", 150, null, null)', '07:14');
149 shouldBeEqualToString('stepDown("07:13", 150, null, null)', '07:12');
150 shouldBeEqualToString('stepUp("07:13", 0, null, null)', '07:14');
151 shouldBeEqualToString('stepDown("07:13", 0, null, null)', '07:12');
152 shouldBeEqualToString('stepUp("07:13", 36000, null, null)', '07:00');
153 shouldBeEqualToString('stepDown("07:13", 36000, null, null)', '07:00');
154 shouldBeEqualToString('stepUp("07:13", 660, null, null)', '07:14');
155 shouldBeEqualToString('stepDown("07:13", 660, null, null)', '07:12');
156 shouldBeEqualToString('stepUp("07:13", 600, "00:05", null)', '07:15');
157 shouldBeEqualToString('stepDown("07:13", 600, "00:05", null)', '07:05');
158 shouldBeEqualToString('test("07:13", 600, null, null, ["delete", "upArrow"])', '07:00');
159 shouldBeEqualToString('test("07:13", 600, null, null, ["delete", "downArrow"])', '07:50');
160 shouldBeEqualToString('test("07:13", 600, "00:05", null, ["delete", "upArrow"])', '07:05');
161 shouldBeEqualToString('test("07:13", 600, "00:05", null, ["delete", "downArrow"])', '07:55');
162 shouldBeEqualToString('stepUp("07:10", 1, "07:05", "07:10")', '07:05');
163 shouldBeEqualToString('stepDown("07:05", 1, "07:05", "07:10")', '07:10');
164 shouldBeEqualToString('stepUp("07:05", 1, "07:10", "07:20")', '07:10');
165 shouldBeEqualToString('stepDown("07:05", 1, "07:10", "07:20")', '07:20');
166 shouldBeEqualToString('stepUp("07:05", 1, "07:00", "07:00")', '07:00');
167 shouldBeEqualToString('stepDown("07:05", 1, "07:00", "07:00")', '07:00');
168 shouldBeEqualToString('stepUp("07:35", 600, "07:10", "07:35")', '07:10');
169 shouldBeEqualToString('stepDown("07:35", 600, "07:10", "07:35")', '07:30');
170 shouldBeEqualToString('stepUp("07:10", 1, "07:10", "08:20")', '07:11');
171 shouldBeEqualToString('stepDown("07:10", 1, "07:10", "08:20")', '07:09');
172
173 debug('Hours, 1-12');
174 keyDown('leftArrow');
175 shouldBeEqualToString('stepUp("07:00", 1, null, null)', '08:00');
176 shouldBeEqualToString('stepDown("07:00", 1, null, null)', '06:00');
177 shouldBeEqualToString('stepUp("11:00", 1, null, null)', '00:00');
178 shouldBeEqualToString('stepDown("00:00", 1, null, null)', '11:00');
179 shouldBeEqualToString('stepUp("06:00", 7200, null, null)', '08:00');
180 shouldBeEqualToString('stepDown("06:00", 7200, null, null)', '04:00');
181 shouldBeEqualToString('stepUp("10:00", 7200, null, null)', '00:00');
182 shouldBeEqualToString('stepDown("00:00", 7200, null, null)', '10:00');
183 shouldBeEqualToString('stepUp("07:00", 7200, null, null)', '08:00');
184 shouldBeEqualToString('stepDown("07:00", 7200, null, null)', '06:00');
185 shouldBeEqualToString('stepUp("06:00", 3601, null, null)', '07:00');
186 shouldBeEqualToString('stepDown("06:00", 3601, null, null)', '05:00');
187 shouldBeEqualToString('stepUp("06:00", 0, null, null)', '07:00');
188 shouldBeEqualToString('stepDown("06:00", 0, null, null)', '05:00');
189 shouldBeEqualToString('stepUp("06:00", 86400, null, null)', '00:00');
190 shouldBeEqualToString('stepDown("06:00", 86400, null, null)', '00:00');
191 shouldBeEqualToString('stepUp("06:00", 36000, null, null)', '07:00');
192 shouldBeEqualToString('stepDown("06:00", 36000, null, null)', '05:00');
193 shouldBeEqualToString('stepUp("06:00", 7200, "01:00", null)', '07:00');
194 shouldBeEqualToString('stepDown("06:00", 7200, "01:00", null)', '05:00');
195 shouldBeEqualToString('test("06:00", 7200, null, null, ["delete", "upArrow"])', '02:00');
196 shouldBeEqualToString('test("06:00", 7200, null, null, ["delete", "downArrow"])', '00:00');
197 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '12:00 AM');
198 shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["delete", "upArrow"])', '01:00');
199 shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["delete", "downArrow"])', '11:00');
200 shouldBeEqualToString('stepUp("17:00", 1, "17:00", "20:00")', '18:00');
201 shouldBeEqualToString('stepDown("17:00", 1, "17:00", "20:00")', '20:00');
202 shouldBeEqualToString('stepUp("17:00", 1, "15:00", "17:00")', '15:00');
203 shouldBeEqualToString('stepDown("17:00", 1, "15:00", "17:00")', '16:00');
204 shouldBeEqualToString('stepUp("15:00", 1, "17:00", "20:00")', '17:00');
205 shouldBeEqualToString('stepDown("15:00", 1, "17:00", "20:00")', '20:00');
206 shouldBeEqualToString('stepUp("15:00", 1, "13:00", "13:00")', '13:00');
207 shouldBeEqualToString('stepDown("15:00", 1, "13:00", "13:00")', '13:00');
208 shouldBeEqualToString('stepUp("12:00", 1, "12:00", "15:00")', '13:00');
209 shouldBeEqualToString('stepDown("12:00", 1, "12:00", "15:00")', '23:00');
210 shouldBeEqualToString('stepUp("15:00", 1, "12:00", "15:00")', '16:00');
211 shouldBeEqualToString('stepDown("15:00", 1, "12:00", "15:00")', '14:00');
212 shouldBeEqualToString('stepUp("12:00", 1, "10:00", "12:00")', '13:00');
213 shouldBeEqualToString('stepDown("12:00", 1, "10:00", "12:00")', '23:00');
214 shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00');
215 shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '11:00');
216 shouldBeEqualToString('stepUp("15:00", 1, "10:00", "15:00")', '16:00');
217 shouldBeEqualToString('stepDown("10:00", 1, "10:00", "15:00")', '09:00');
218 shouldBeEqualToString('stepUp("17:00", 7200, "17:00", "20:00")', '19:00');
219 shouldBeEqualToString('stepDown("17:00", 7200, "17:00", "20:00")', '19:00');
220 shouldBeEqualToString('stepUp("17:00", 7200, "17:00", "18:00")', '17:00');
221 shouldBeEqualToString('stepDown("17:00", 7200, "17:00", "18:00")', '17:00');
222
223 debug('Hours, 0-11');
224 setDateTimeFormat('KK:mm a');
225 shouldBeEqualToString('stepUp("11:00", 1, null, null)', '00:00');
226 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '00:00 AM');
227 shouldBeEqualToString('stepDown("00:00", 1, null, null)', '11:00');
228 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '11:00 AM');
229 shouldBeEqualToString('stepUp("23:00", 1, null, null)', '12:00');
230 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '00:00 PM');
231 shouldBeEqualToString('stepDown("12:00", 1, null, null)', '23:00');
232 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '11:00 PM');
233 shouldBeEqualToString('test("06:00", 7200, null, null, ["delete", "upArrow"])', '00:00');
234 shouldBeEqualToString('test("06:00", 7200, null, null, ["delete", "downArrow"])', '10:00');
235 shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["delete", "upArrow"])', '01:00');
236 shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["delete", "downArrow"])', '11:00');
237 shouldBeEqualToString('stepUp("17:00", 1, "17:00", "20:00")', '18:00');
238 shouldBeEqualToString('stepDown("17:00", 1, "17:00", "20:00")', '20:00');
239 shouldBeEqualToString('stepUp("17:00", 1, "15:00", "17:00")', '15:00');
240 shouldBeEqualToString('stepDown("17:00", 1, "15:00", "17:00")', '16:00');
241 shouldBeEqualToString('stepUp("15:00", 1, "17:00", "20:00")', '17:00');
242 shouldBeEqualToString('stepDown("15:00", 1, "17:00", "20:00")', '20:00');
243 shouldBeEqualToString('stepUp("15:00", 1, "13:00", "13:00")', '13:00');
244 shouldBeEqualToString('stepDown("15:00", 1, "13:00", "13:00")', '13:00');
245 shouldBeEqualToString('stepUp("12:00", 1, "12:00", "15:00")', '13:00');
246 shouldBeEqualToString('stepDown("12:00", 1, "12:00", "15:00")', '15:00');
247 shouldBeEqualToString('stepUp("15:00", 1, "12:00", "15:00")', '12:00');
248 shouldBeEqualToString('stepDown("15:00", 1, "12:00", "15:00")', '14:00');
249 shouldBeEqualToString('stepUp("12:00", 1, "10:00", "12:00")', '13:00');
250 shouldBeEqualToString('stepDown("12:00", 1, "10:00", "12:00")', '23:00');
251 shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00');
252 shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '03:00');
253 shouldBeEqualToString('stepUp("15:00", 1, "10:00", "15:00")', '16:00');
254 shouldBeEqualToString('stepDown("10:00", 1, "10:00", "15:00")', '09:00');
255 shouldBeEqualToString('stepUp("20:00", 7200, "17:00", "20:00")', '17:00');
256 shouldBeEqualToString('stepDown("20:00", 7200, "17:00", "20:00")', '19:00');
257
258 debug('Hours, 0-23');
259 setDateTimeFormat('HH:mm');
260 shouldBeEqualToString('stepUp("07:00", 1, null, null)', '08:00');
261 shouldBeEqualToString('stepDown("07:00", 1, null, null)', '06:00');
262 shouldBeEqualToString('stepUp("23:00", 1, null, null)', '00:00');
263 shouldBeEqualToString('stepDown("00:00", 1, null, null)', '23:00');
264 shouldBeEqualToString('stepUp("06:00", 7200, null, null)', '08:00');
265 shouldBeEqualToString('stepDown("06:00", 7200, null, null)', '04:00');
266 shouldBeEqualToString('stepUp("22:00", 7200, null, null)', '00:00');
267 shouldBeEqualToString('stepDown("00:00", 7200, null, null)', '22:00');
268 shouldBeEqualToString('stepUp("07:00", 7200, null, null)', '08:00');
269 shouldBeEqualToString('stepDown("07:00", 7200, null, null)', '06:00');
270 shouldBeEqualToString('stepUp("06:00", 3601, null, null)', '07:00');
271 shouldBeEqualToString('stepDown("06:00", 3601, null, null)', '05:00');
272 shouldBeEqualToString('stepUp("06:00", 0, null, null)', '07:00');
273 shouldBeEqualToString('stepDown("06:00", 0, null, null)', '05:00');
274 shouldBeEqualToString('stepUp("06:00", 86400, null, null)', '00:00');
275 shouldBeEqualToString('stepDown("06:00", 86400, null, null)', '00:00');
276 shouldBeEqualToString('stepUp("06:00", 36000, null, null)', '07:00');
277 shouldBeEqualToString('stepDown("06:00", 36000, null, null)', '05:00');
278 shouldBeEqualToString('stepUp("06:00", 7200, "01:00", null)', '07:00');
279 shouldBeEqualToString('stepDown("06:00", 7200, "01:00", null)', '05:00');
280 shouldBeEqualToString('test("06:00", 7200, null, null, ["delete", "upArrow"])', '00:00');
281 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '00:00');
282 shouldBeEqualToString('test("06:00", 7200, null, null, ["delete", "downArrow"])', '22:00');
283 shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["delete", "upArrow"])', '01:00');
284 shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["delete", "downArrow"])', '23:00');
285 shouldBeEqualToString('stepUp("17:00", 1, "17:00", "20:00")', '18:00');
286 shouldBeEqualToString('stepDown("17:00", 1, "17:00", "20:00")', '20:00');
287 shouldBeEqualToString('stepUp("17:00", 1, "15:00", "17:00")', '15:00');
288 shouldBeEqualToString('stepDown("17:00", 1, "15:00", "17:00")', '16:00');
289 shouldBeEqualToString('stepUp("15:00", 1, "17:00", "20:00")', '17:00');
290 shouldBeEqualToString('stepDown("15:00", 1, "17:00", "20:00")', '20:00');
291 shouldBeEqualToString('stepUp("15:00", 1, "13:00", "13:00")', '13:00');
292 shouldBeEqualToString('stepDown("15:00", 1, "13:00", "13:00")', '13:00');
293 shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00');
294 shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '03:00');
295 shouldBeEqualToString('stepUp("03:00", 1, "00:00", "03:00")', '00:00');
296 shouldBeEqualToString('stepDown("03:00", 1, "00:00", "03:00")', '02:00');
297 shouldBeEqualToString('stepUp("12:00", 1, "10:00", "12:00")', '10:00');
298 shouldBeEqualToString('stepDown("12:00", 1, "10:00", "12:00")', '11:00');
299 shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00');
300 shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '03:00');
301 shouldBeEqualToString('stepUp("15:00", 1, "10:00", "15:00")', '10:00');
302 shouldBeEqualToString('stepDown("10:00", 1, "10:00", "15:00")', '15:00');
303 shouldBeEqualToString('stepUp("20:00", 7200, "17:00", "20:00")', '17:00');
304 shouldBeEqualToString('stepDown("20:00", 7200, "17:00", "20:00")', '19:00');
305
306 debug('Hours, 1-24');
307 setDateTimeFormat('kk:mm');
308 shouldBeEqualToString('stepUp("11:00", 1, null, null)', '12:00');
309 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '12:00');
310 shouldBeEqualToString('stepDown("00:00", 1, null, null)', '23:00');
311 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '23:00');
312 shouldBeEqualToString('stepUp("23:00", 1, null, null)', '00:00');
313 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '24:00');
314 shouldBeEqualToString('stepDown("12:00", 1, null, null)', '11:00');
315 shouldBeEqualToString('getUserAgentShadowTextContent(input)', '11:00');
316 shouldBeEqualToString('test("06:00", 7200, null, null, ["delete", "upArrow"])', '02:00');
317 shouldBeEqualToString('test("06:00", 7200, null, null, ["delete", "downArrow"])', '00:00');
318 shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["delete", "upArrow"])', '01:00');
319 shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["delete", "downArrow"])', '23:00');
320 shouldBeEqualToString('stepUp("17:00", 1, "17:00", "20:00")', '18:00');
321 shouldBeEqualToString('stepDown("17:00", 1, "17:00", "20:00")', '20:00');
322 shouldBeEqualToString('stepUp("17:00", 1, "15:00", "17:00")', '15:00');
323 shouldBeEqualToString('stepDown("17:00", 1, "15:00", "17:00")', '16:00');
324 shouldBeEqualToString('stepUp("15:00", 1, "17:00", "20:00")', '17:00');
325 shouldBeEqualToString('stepDown("15:00", 1, "17:00", "20:00")', '20:00');
326 shouldBeEqualToString('stepUp("15:00", 1, "13:00", "13:00")', '13:00');
327 shouldBeEqualToString('stepDown("15:00", 1, "13:00", "13:00")', '13:00');
328 shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00');
329 shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '23:00');
330 shouldBeEqualToString('stepUp("03:00", 1, "00:00", "03:00")', '04:00');
331 shouldBeEqualToString('stepDown("03:00", 1, "00:00", "03:00")', '02:00');
332 shouldBeEqualToString('stepUp("12:00", 1, "10:00", "12:00")', '10:00');
333 shouldBeEqualToString('stepDown("12:00", 1, "10:00", "12:00")', '11:00');
334 shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00');
335 shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '23:00');
336 shouldBeEqualToString('stepUp("15:00", 1, "10:00", "15:00")', '10:00');
337 shouldBeEqualToString('stepDown("10:00", 1, "10:00", "15:00")', '15:00');
338 shouldBeEqualToString('stepUp("17:00", 7200, "17:00", "20:00")', '19:00');
339 shouldBeEqualToString('stepDown("17:00", 7200, "17:00", "20:00")', '19:00');
340 shouldBeEqualToString('stepUp("17:00", 7200, "17:00", "18:00")', '17:00');
341 shouldBeEqualToString('stepDown("17:00", 7200, "17:00", "18:00")', '17:00');
342
343 setDateTimeFormat('');
344 debug('');
345 document.body.removeChild(input);
346 </script>
347 <script src="../../js/resources/js-test-post.js"></script>
348 </body>
349 </html>