Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer-hour.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer-hour.html b/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer-hour.html |
| index 84fd85a3c6e7d2bf76ac946660811d86846a069c..b9e0b5f2d4656b138eaad79d89ebfe3fe59ae22a 100644 |
| --- a/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer-hour.html |
| +++ b/third_party/WebKit/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer-hour.html |
| @@ -1,237 +1,249 @@ |
| <!DOCTYPE html> |
| <html> |
| <head> |
| -<script src="../../../resources/js-test.js"></script> |
| +<script src="../../../resources/testharness.js"></script> |
| +<script src="../../../resources/testharnessreport.js"></script> |
| <script src="../resources/common.js"></script> |
| </head> |
| <body> |
| <script> |
| -description('Check stepping-up and -down for time input fields from renderer. No cases of empty initial values.'); |
| -if (!window.internals) |
| - testFailed('This test requires window.internals.'); |
| - |
| +// We use a single INPUT element for multiple testcases to improve test performance. |
| var input = document.createElement('input'); |
| +input.type = 'time'; |
| document.body.appendChild(input); |
| - |
| -function keyDown(key, modifiers) |
| -{ |
| - if (!window.eventSender) |
| - return; |
| - eventSender.keyDown(key, modifiers); |
| -} |
| +input.focus(); |
| function setDateTimeFormat(pattern) { |
| - getElementByPseudoId(internals.youngestShadowRoot(input), '-webkit-datetime-edit').setAttribute('pattern', pattern); |
| - input.value = ''; // Updates the element for new format |
| + getElementByPseudoId(internals.youngestShadowRoot(input), '-webkit-datetime-edit').setAttribute('pattern', pattern); |
| + input.value = ''; // Updates the element for new format |
| } |
| function maybeUpdateAttribute(name, value) { |
| - if (value) { |
| - if (input.getAttribute(name) != value) |
| - input.setAttribute(name, value); |
| - } else { |
| - if (input.hasAttribute(name)) |
| - input.removeAttribute(name); |
| - } |
| + if (value) { |
| + if (input.getAttribute(name) != value) |
|
yosin_UTC9
2017/01/13 07:13:52
nit: s/!=/!==/
tkent
2017/01/13 08:39:02
Done
|
| + input.setAttribute(name, value); |
| + } else { |
| + if (input.hasAttribute(name)) |
| + input.removeAttribute(name); |
| + } |
| } |
| -function setInputAttributes(value, min, max, step) { |
| - input.value = value; |
| - maybeUpdateAttribute('min', min); |
| - maybeUpdateAttribute('max', max); |
| - maybeUpdateAttribute('step', step); |
| +function assert_input_value_with_limits(initial, step, min, max, keySequence, expected, expectedDisplayValue) { |
| + input.value = initial; |
| + maybeUpdateAttribute('min', min); |
| + maybeUpdateAttribute('max', max); |
| + maybeUpdateAttribute('step', step); |
| + |
| + for (var i = 0; i < keySequence.length; ++i) |
|
yosin_UTC9
2017/01/13 07:13:52
nit: s/var/let/
tkent
2017/01/13 08:39:02
I made this |forEach|.
|
| + eventSender.keyDown(keySequence[i]); |
| + |
| + assert_equals(input.value, expected); |
| + if (expectedDisplayValue) |
| + assert_equals(getUserAgentShadowTextContent(input), expectedDisplayValue); |
| } |
| -function test(value, step, min, max, keySequence) { |
| - setInputAttributes(value, min, max, step); |
| - for (var i = 0; i < keySequence.length; i++) |
| - keyDown(keySequence[i]); |
| - return input.value; |
| +function assert_input_value_with_limits_after_up(initial, step, min, max, expected, expectedDisplayValue) { |
| + assert_input_value_with_limits(initial, step, min, max, ['ArrowUp'], expected, expectedDisplayValue); |
| } |
| -function stepUp(value, step, min, max) { |
| - return test(value, step, min, max, ['ArrowUp']); |
| +function assert_input_value_with_limits_after_down(initial, step, min, max, expected, expectedDisplayValue) { |
| + assert_input_value_with_limits(initial, step, min, max, ['ArrowDown'], expected, expectedDisplayValue); |
| } |
| -function stepDown(value, step, min, max) { |
| - return test(value, step, min, max, ['ArrowDown']); |
| +function assert_input_value_with_limits_after_deleteup(initial, step, min, max, expected, expectedDisplayValue) { |
| + assert_input_value_with_limits(initial, step, min, max, ['Delete', 'ArrowUp'], expected, expectedDisplayValue); |
| } |
| -input.type = 'time'; |
| -input.focus(); |
| +function assert_input_value_with_limits_after_deletedown(initial, step, min, max, expected, expectedDisplayValue) { |
| + assert_input_value_with_limits(initial, step, min, max, ['Delete', 'ArrowDown'], expected, expectedDisplayValue); |
| +} |
| + |
| +function assert_input_value_after_up(initial, step, expected, expectedDisplayValue) { |
| + assert_input_value_with_limits(initial, step, null, null, ['ArrowUp'], expected, expectedDisplayValue); |
| +} |
| + |
| +function assert_input_value_after_down(initial, step, expected, expectedDisplayValue) { |
| + assert_input_value_with_limits(initial, step, null, null, ['ArrowDown'], expected, expectedDisplayValue); |
| +} |
| + |
| +// Hours, 1-12 |
| +test(() => { |
| + assert_exists(window, 'internals'); |
|
yosin_UTC9
2017/01/13 07:13:52
You found new pattern. It is better than before.
|
| + assert_exists(window, 'eventSender'); |
| + |
| + assert_input_value_after_up('07:00', 1, '08:00'); |
| + assert_input_value_after_down('07:00', 1, '06:00'); |
| + assert_input_value_after_up('11:00', 1, '00:00'); |
| + assert_input_value_after_down('00:00', 1, '11:00'); |
| + assert_input_value_after_up('06:00', 7200, '08:00'); |
| + assert_input_value_after_down('06:00', 7200, '04:00'); |
| + assert_input_value_after_up('10:00', 7200, '00:00'); |
| + assert_input_value_after_down('00:00', 7200, '10:00'); |
| + assert_input_value_after_up('07:00', 7200, '08:00'); |
| + assert_input_value_after_down('07:00', 7200, '06:00'); |
| + assert_input_value_after_up('06:00', 3601, '07:00'); |
| + assert_input_value_after_down('06:00', 3601, '05:00'); |
| + assert_input_value_after_up('06:00', 0, '07:00'); |
| + assert_input_value_after_down('06:00', 0, '05:00'); |
| + assert_input_value_after_up('06:00', 86400, '00:00'); |
| + assert_input_value_after_down('06:00', 86400, '00:00'); |
| + assert_input_value_after_up('06:00', 36000, '07:00'); |
| + assert_input_value_after_down('06:00', 36000, '05:00'); |
| + assert_input_value_with_limits_after_up('06:00', 7200, '01:00', null, '07:00'); |
| + assert_input_value_with_limits_after_down('06:00', 7200, '01:00', null, '05:00'); |
| + assert_input_value_with_limits_after_deleteup('06:00', 7200, null, null, '02:00'); |
| + assert_input_value_with_limits_after_deletedown('06:00', 7200, null, null, '00:00', '12:00 AM'); |
| + assert_input_value_with_limits_after_deleteup('06:00', 7200, '01:00', null, '01:00'); |
| + assert_input_value_with_limits_after_deletedown('06:00', 7200, '01:00', null, '11:00'); |
| + assert_input_value_with_limits_after_up('17:00', 1, '17:00', '20:00', '18:00'); |
| + assert_input_value_with_limits_after_down('17:00', 1, '17:00', '20:00', '20:00'); |
| + assert_input_value_with_limits_after_up('17:00', 1, '15:00', '17:00', '15:00'); |
| + assert_input_value_with_limits_after_down('17:00', 1, '15:00', '17:00', '16:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '17:00', '20:00', '17:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '17:00', '20:00', '20:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '13:00', '13:00', '13:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '13:00', '13:00', '13:00'); |
| + assert_input_value_with_limits_after_up('12:00', 1, '12:00', '15:00', '13:00'); |
| + assert_input_value_with_limits_after_down('12:00', 1, '12:00', '15:00', '23:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '12:00', '15:00', '16:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '12:00', '15:00', '14:00'); |
| + assert_input_value_with_limits_after_up('12:00', 1, '10:00', '12:00', '13:00'); |
| + assert_input_value_with_limits_after_down('12:00', 1, '10:00', '12:00', '23:00'); |
| + assert_input_value_with_limits_after_up('00:00', 1, '00:00', '03:00', '01:00'); |
| + assert_input_value_with_limits_after_down('00:00', 1, '00:00', '03:00', '11:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '10:00', '15:00', '16:00'); |
| + assert_input_value_with_limits_after_down('10:00', 1, '10:00', '15:00', '09:00'); |
| + assert_input_value_with_limits_after_up('17:00', 7200, '17:00', '20:00', '19:00'); |
| + assert_input_value_with_limits_after_down('17:00', 7200, '17:00', '20:00', '19:00'); |
| + assert_input_value_with_limits_after_up('17:00', 7200, '17:00', '18:00', '17:00'); |
| + assert_input_value_with_limits_after_down('17:00', 7200, '17:00', '18:00', '17:00'); |
| +}, 'Hours, 1-12'); |
| + |
| +// Hours, 0-11 |
| +test(() => { |
| + assert_exists(window, 'internals'); |
| + assert_exists(window, 'eventSender'); |
| + setDateTimeFormat('KK:mm a'); |
| + |
| + assert_input_value_after_up('11:00', 1, '00:00', '00:00 AM'); |
| + assert_input_value_after_down('00:00', 1, '11:00', '11:00 AM'); |
| + assert_input_value_after_up('23:00', 1, '12:00', '00:00 PM'); |
| + assert_input_value_after_down('12:00', 1, '23:00', '11:00 PM'); |
| + assert_input_value_with_limits_after_deleteup('06:00', 7200, null, null, '00:00'); |
| + assert_input_value_with_limits_after_deletedown('06:00', 7200, null, null, '10:00'); |
| + assert_input_value_with_limits_after_deleteup('06:00', 7200, '01:00', null, '01:00'); |
| + assert_input_value_with_limits_after_deletedown('06:00', 7200, '01:00', null, '11:00'); |
| + assert_input_value_with_limits_after_up('17:00', 1, '17:00', '20:00', '18:00'); |
| + assert_input_value_with_limits_after_down('17:00', 1, '17:00', '20:00', '20:00'); |
| + assert_input_value_with_limits_after_up('17:00', 1, '15:00', '17:00', '15:00'); |
| + assert_input_value_with_limits_after_down('17:00', 1, '15:00', '17:00', '16:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '17:00', '20:00', '17:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '17:00', '20:00', '20:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '13:00', '13:00', '13:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '13:00', '13:00', '13:00'); |
| + assert_input_value_with_limits_after_up('12:00', 1, '12:00', '15:00', '13:00'); |
| + assert_input_value_with_limits_after_down('12:00', 1, '12:00', '15:00', '15:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '12:00', '15:00', '12:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '12:00', '15:00', '14:00'); |
| + assert_input_value_with_limits_after_up('12:00', 1, '10:00', '12:00', '13:00'); |
| + assert_input_value_with_limits_after_down('12:00', 1, '10:00', '12:00', '23:00'); |
| + assert_input_value_with_limits_after_up('00:00', 1, '00:00', '03:00', '01:00'); |
| + assert_input_value_with_limits_after_down('00:00', 1, '00:00', '03:00', '03:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '10:00', '15:00', '16:00'); |
| + assert_input_value_with_limits_after_down('10:00', 1, '10:00', '15:00', '09:00'); |
| + assert_input_value_with_limits_after_up('20:00', 7200, '17:00', '20:00', '17:00'); |
| + assert_input_value_with_limits_after_down('20:00', 7200, '17:00', '20:00', '19:00'); |
| +}, 'Hours, 0-11'); |
| + |
| +// Hours, 0-23 |
| +test(() => { |
| + assert_exists(window, 'internals'); |
| + assert_exists(window, 'eventSender'); |
| + setDateTimeFormat('HH:mm'); |
| + |
| + assert_input_value_after_up('07:00', 1, '08:00'); |
| + assert_input_value_after_down('07:00', 1, '06:00'); |
| + assert_input_value_after_up('23:00', 1, '00:00'); |
| + assert_input_value_after_down('00:00', 1, '23:00'); |
| + assert_input_value_after_up('06:00', 7200, '08:00'); |
| + assert_input_value_after_down('06:00', 7200, '04:00'); |
| + assert_input_value_after_up('22:00', 7200, '00:00'); |
| + assert_input_value_after_down('00:00', 7200, '22:00'); |
| + assert_input_value_after_up('07:00', 7200, '08:00'); |
| + assert_input_value_after_down('07:00', 7200, '06:00'); |
| + assert_input_value_after_up('06:00', 3601, '07:00'); |
| + assert_input_value_after_down('06:00', 3601, '05:00'); |
| + assert_input_value_after_up('06:00', 0, '07:00'); |
| + assert_input_value_after_down('06:00', 0, '05:00'); |
| + assert_input_value_after_up('06:00', 86400, '00:00'); |
| + assert_input_value_after_down('06:00', 86400, '00:00'); |
| + assert_input_value_after_up('06:00', 36000, '07:00'); |
| + assert_input_value_after_down('06:00', 36000, '05:00'); |
| + assert_input_value_with_limits_after_up('06:00', 7200, '01:00', null, '07:00'); |
| + assert_input_value_with_limits_after_down('06:00', 7200, '01:00', null, '05:00'); |
| + assert_input_value_with_limits_after_deleteup('06:00', 7200, null, null, '00:00', '00:00'); |
| + assert_input_value_with_limits_after_deletedown('06:00', 7200, null, null, '22:00'); |
| + assert_input_value_with_limits_after_deleteup('06:00', 7200, '01:00', null, '01:00'); |
| + assert_input_value_with_limits_after_deletedown('06:00', 7200, '01:00', null, '23:00'); |
| + assert_input_value_with_limits_after_up('17:00', 1, '17:00', '20:00', '18:00'); |
| + assert_input_value_with_limits_after_down('17:00', 1, '17:00', '20:00', '20:00'); |
| + assert_input_value_with_limits_after_up('17:00', 1, '15:00', '17:00', '15:00'); |
| + assert_input_value_with_limits_after_down('17:00', 1, '15:00', '17:00', '16:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '17:00', '20:00', '17:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '17:00', '20:00', '20:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '13:00', '13:00', '13:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '13:00', '13:00', '13:00'); |
| + assert_input_value_with_limits_after_up('00:00', 1, '00:00', '03:00', '01:00'); |
| + assert_input_value_with_limits_after_down('00:00', 1, '00:00', '03:00', '03:00'); |
| + assert_input_value_with_limits_after_up('03:00', 1, '00:00', '03:00', '00:00'); |
| + assert_input_value_with_limits_after_down('03:00', 1, '00:00', '03:00', '02:00'); |
| + assert_input_value_with_limits_after_up('12:00', 1, '10:00', '12:00', '10:00'); |
| + assert_input_value_with_limits_after_down('12:00', 1, '10:00', '12:00', '11:00'); |
| + assert_input_value_with_limits_after_up('00:00', 1, '00:00', '03:00', '01:00'); |
| + assert_input_value_with_limits_after_down('00:00', 1, '00:00', '03:00', '03:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '10:00', '15:00', '10:00'); |
| + assert_input_value_with_limits_after_down('10:00', 1, '10:00', '15:00', '15:00'); |
| + assert_input_value_with_limits_after_up('20:00', 7200, '17:00', '20:00', '17:00'); |
| + assert_input_value_with_limits_after_down('20:00', 7200, '17:00', '20:00', '19:00'); |
| +}, 'Hours, 0-23'); |
| + |
| +// Hours, 1-24 |
| +test(() => { |
| + assert_exists(window, 'internals'); |
| + assert_exists(window, 'eventSender'); |
| + setDateTimeFormat('kk:mm'); |
| -debug('Hours, 1-12'); |
| -shouldBeEqualToString('stepUp("07:00", 1, null, null)', '08:00'); |
| -shouldBeEqualToString('stepDown("07:00", 1, null, null)', '06:00'); |
| -shouldBeEqualToString('stepUp("11:00", 1, null, null)', '00:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, null, null)', '11:00'); |
| -shouldBeEqualToString('stepUp("06:00", 7200, null, null)', '08:00'); |
| -shouldBeEqualToString('stepDown("06:00", 7200, null, null)', '04:00'); |
| -shouldBeEqualToString('stepUp("10:00", 7200, null, null)', '00:00'); |
| -shouldBeEqualToString('stepDown("00:00", 7200, null, null)', '10:00'); |
| -shouldBeEqualToString('stepUp("07:00", 7200, null, null)', '08:00'); |
| -shouldBeEqualToString('stepDown("07:00", 7200, null, null)', '06:00'); |
| -shouldBeEqualToString('stepUp("06:00", 3601, null, null)', '07:00'); |
| -shouldBeEqualToString('stepDown("06:00", 3601, null, null)', '05:00'); |
| -shouldBeEqualToString('stepUp("06:00", 0, null, null)', '07:00'); |
| -shouldBeEqualToString('stepDown("06:00", 0, null, null)', '05:00'); |
| -shouldBeEqualToString('stepUp("06:00", 86400, null, null)', '00:00'); |
| -shouldBeEqualToString('stepDown("06:00", 86400, null, null)', '00:00'); |
| -shouldBeEqualToString('stepUp("06:00", 36000, null, null)', '07:00'); |
| -shouldBeEqualToString('stepDown("06:00", 36000, null, null)', '05:00'); |
| -shouldBeEqualToString('stepUp("06:00", 7200, "01:00", null)', '07:00'); |
| -shouldBeEqualToString('stepDown("06:00", 7200, "01:00", null)', '05:00'); |
| -shouldBeEqualToString('test("06:00", 7200, null, null, ["Delete", "ArrowUp"])', '02:00'); |
| -shouldBeEqualToString('test("06:00", 7200, null, null, ["Delete", "ArrowDown"])', '00:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '12:00 AM'); |
| -shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["Delete", "ArrowUp"])', '01:00'); |
| -shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["Delete", "ArrowDown"])', '11:00'); |
| -shouldBeEqualToString('stepUp("17:00", 1, "17:00", "20:00")', '18:00'); |
| -shouldBeEqualToString('stepDown("17:00", 1, "17:00", "20:00")', '20:00'); |
| -shouldBeEqualToString('stepUp("17:00", 1, "15:00", "17:00")', '15:00'); |
| -shouldBeEqualToString('stepDown("17:00", 1, "15:00", "17:00")', '16:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "17:00", "20:00")', '17:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "17:00", "20:00")', '20:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "13:00", "13:00")', '13:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "13:00", "13:00")', '13:00'); |
| -shouldBeEqualToString('stepUp("12:00", 1, "12:00", "15:00")', '13:00'); |
| -shouldBeEqualToString('stepDown("12:00", 1, "12:00", "15:00")', '23:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "12:00", "15:00")', '16:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "12:00", "15:00")', '14:00'); |
| -shouldBeEqualToString('stepUp("12:00", 1, "10:00", "12:00")', '13:00'); |
| -shouldBeEqualToString('stepDown("12:00", 1, "10:00", "12:00")', '23:00'); |
| -shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '11:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "10:00", "15:00")', '16:00'); |
| -shouldBeEqualToString('stepDown("10:00", 1, "10:00", "15:00")', '09:00'); |
| -shouldBeEqualToString('stepUp("17:00", 7200, "17:00", "20:00")', '19:00'); |
| -shouldBeEqualToString('stepDown("17:00", 7200, "17:00", "20:00")', '19:00'); |
| -shouldBeEqualToString('stepUp("17:00", 7200, "17:00", "18:00")', '17:00'); |
| -shouldBeEqualToString('stepDown("17:00", 7200, "17:00", "18:00")', '17:00'); |
| - |
| -debug('Hours, 0-11'); |
| -setDateTimeFormat('KK:mm a'); |
| -shouldBeEqualToString('stepUp("11:00", 1, null, null)', '00:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '00:00 AM'); |
| -shouldBeEqualToString('stepDown("00:00", 1, null, null)', '11:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '11:00 AM'); |
| -shouldBeEqualToString('stepUp("23:00", 1, null, null)', '12:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '00:00 PM'); |
| -shouldBeEqualToString('stepDown("12:00", 1, null, null)', '23:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '11:00 PM'); |
| -shouldBeEqualToString('test("06:00", 7200, null, null, ["Delete", "ArrowUp"])', '00:00'); |
| -shouldBeEqualToString('test("06:00", 7200, null, null, ["Delete", "ArrowDown"])', '10:00'); |
| -shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["Delete", "ArrowUp"])', '01:00'); |
| -shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["Delete", "ArrowDown"])', '11:00'); |
| -shouldBeEqualToString('stepUp("17:00", 1, "17:00", "20:00")', '18:00'); |
| -shouldBeEqualToString('stepDown("17:00", 1, "17:00", "20:00")', '20:00'); |
| -shouldBeEqualToString('stepUp("17:00", 1, "15:00", "17:00")', '15:00'); |
| -shouldBeEqualToString('stepDown("17:00", 1, "15:00", "17:00")', '16:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "17:00", "20:00")', '17:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "17:00", "20:00")', '20:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "13:00", "13:00")', '13:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "13:00", "13:00")', '13:00'); |
| -shouldBeEqualToString('stepUp("12:00", 1, "12:00", "15:00")', '13:00'); |
| -shouldBeEqualToString('stepDown("12:00", 1, "12:00", "15:00")', '15:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "12:00", "15:00")', '12:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "12:00", "15:00")', '14:00'); |
| -shouldBeEqualToString('stepUp("12:00", 1, "10:00", "12:00")', '13:00'); |
| -shouldBeEqualToString('stepDown("12:00", 1, "10:00", "12:00")', '23:00'); |
| -shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '03:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "10:00", "15:00")', '16:00'); |
| -shouldBeEqualToString('stepDown("10:00", 1, "10:00", "15:00")', '09:00'); |
| -shouldBeEqualToString('stepUp("20:00", 7200, "17:00", "20:00")', '17:00'); |
| -shouldBeEqualToString('stepDown("20:00", 7200, "17:00", "20:00")', '19:00'); |
| - |
| -debug('Hours, 0-23'); |
| -setDateTimeFormat('HH:mm'); |
| -shouldBeEqualToString('stepUp("07:00", 1, null, null)', '08:00'); |
| -shouldBeEqualToString('stepDown("07:00", 1, null, null)', '06:00'); |
| -shouldBeEqualToString('stepUp("23:00", 1, null, null)', '00:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, null, null)', '23:00'); |
| -shouldBeEqualToString('stepUp("06:00", 7200, null, null)', '08:00'); |
| -shouldBeEqualToString('stepDown("06:00", 7200, null, null)', '04:00'); |
| -shouldBeEqualToString('stepUp("22:00", 7200, null, null)', '00:00'); |
| -shouldBeEqualToString('stepDown("00:00", 7200, null, null)', '22:00'); |
| -shouldBeEqualToString('stepUp("07:00", 7200, null, null)', '08:00'); |
| -shouldBeEqualToString('stepDown("07:00", 7200, null, null)', '06:00'); |
| -shouldBeEqualToString('stepUp("06:00", 3601, null, null)', '07:00'); |
| -shouldBeEqualToString('stepDown("06:00", 3601, null, null)', '05:00'); |
| -shouldBeEqualToString('stepUp("06:00", 0, null, null)', '07:00'); |
| -shouldBeEqualToString('stepDown("06:00", 0, null, null)', '05:00'); |
| -shouldBeEqualToString('stepUp("06:00", 86400, null, null)', '00:00'); |
| -shouldBeEqualToString('stepDown("06:00", 86400, null, null)', '00:00'); |
| -shouldBeEqualToString('stepUp("06:00", 36000, null, null)', '07:00'); |
| -shouldBeEqualToString('stepDown("06:00", 36000, null, null)', '05:00'); |
| -shouldBeEqualToString('stepUp("06:00", 7200, "01:00", null)', '07:00'); |
| -shouldBeEqualToString('stepDown("06:00", 7200, "01:00", null)', '05:00'); |
| -shouldBeEqualToString('test("06:00", 7200, null, null, ["Delete", "ArrowUp"])', '00:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '00:00'); |
| -shouldBeEqualToString('test("06:00", 7200, null, null, ["Delete", "ArrowDown"])', '22:00'); |
| -shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["Delete", "ArrowUp"])', '01:00'); |
| -shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["Delete", "ArrowDown"])', '23:00'); |
| -shouldBeEqualToString('stepUp("17:00", 1, "17:00", "20:00")', '18:00'); |
| -shouldBeEqualToString('stepDown("17:00", 1, "17:00", "20:00")', '20:00'); |
| -shouldBeEqualToString('stepUp("17:00", 1, "15:00", "17:00")', '15:00'); |
| -shouldBeEqualToString('stepDown("17:00", 1, "15:00", "17:00")', '16:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "17:00", "20:00")', '17:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "17:00", "20:00")', '20:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "13:00", "13:00")', '13:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "13:00", "13:00")', '13:00'); |
| -shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '03:00'); |
| -shouldBeEqualToString('stepUp("03:00", 1, "00:00", "03:00")', '00:00'); |
| -shouldBeEqualToString('stepDown("03:00", 1, "00:00", "03:00")', '02:00'); |
| -shouldBeEqualToString('stepUp("12:00", 1, "10:00", "12:00")', '10:00'); |
| -shouldBeEqualToString('stepDown("12:00", 1, "10:00", "12:00")', '11:00'); |
| -shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '03:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "10:00", "15:00")', '10:00'); |
| -shouldBeEqualToString('stepDown("10:00", 1, "10:00", "15:00")', '15:00'); |
| -shouldBeEqualToString('stepUp("20:00", 7200, "17:00", "20:00")', '17:00'); |
| -shouldBeEqualToString('stepDown("20:00", 7200, "17:00", "20:00")', '19:00'); |
| - |
| -debug('Hours, 1-24'); |
| -setDateTimeFormat('kk:mm'); |
| -shouldBeEqualToString('stepUp("11:00", 1, null, null)', '12:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '12:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, null, null)', '23:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '23:00'); |
| -shouldBeEqualToString('stepUp("23:00", 1, null, null)', '00:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '24:00'); |
| -shouldBeEqualToString('stepDown("12:00", 1, null, null)', '11:00'); |
| -shouldBeEqualToString('getUserAgentShadowTextContent(input)', '11:00'); |
| -shouldBeEqualToString('test("06:00", 7200, null, null, ["Delete", "ArrowUp"])', '02:00'); |
| -shouldBeEqualToString('test("06:00", 7200, null, null, ["Delete", "ArrowDown"])', '00:00'); |
| -shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["Delete", "ArrowUp"])', '01:00'); |
| -shouldBeEqualToString('test("06:00", 7200, "01:00", null, ["Delete", "ArrowDown"])', '23:00'); |
| -shouldBeEqualToString('stepUp("17:00", 1, "17:00", "20:00")', '18:00'); |
| -shouldBeEqualToString('stepDown("17:00", 1, "17:00", "20:00")', '20:00'); |
| -shouldBeEqualToString('stepUp("17:00", 1, "15:00", "17:00")', '15:00'); |
| -shouldBeEqualToString('stepDown("17:00", 1, "15:00", "17:00")', '16:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "17:00", "20:00")', '17:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "17:00", "20:00")', '20:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "13:00", "13:00")', '13:00'); |
| -shouldBeEqualToString('stepDown("15:00", 1, "13:00", "13:00")', '13:00'); |
| -shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '23:00'); |
| -shouldBeEqualToString('stepUp("03:00", 1, "00:00", "03:00")', '04:00'); |
| -shouldBeEqualToString('stepDown("03:00", 1, "00:00", "03:00")', '02:00'); |
| -shouldBeEqualToString('stepUp("12:00", 1, "10:00", "12:00")', '10:00'); |
| -shouldBeEqualToString('stepDown("12:00", 1, "10:00", "12:00")', '11:00'); |
| -shouldBeEqualToString('stepUp("00:00", 1, "00:00", "03:00")', '01:00'); |
| -shouldBeEqualToString('stepDown("00:00", 1, "00:00", "03:00")', '23:00'); |
| -shouldBeEqualToString('stepUp("15:00", 1, "10:00", "15:00")', '10:00'); |
| -shouldBeEqualToString('stepDown("10:00", 1, "10:00", "15:00")', '15:00'); |
| -shouldBeEqualToString('stepUp("17:00", 7200, "17:00", "20:00")', '19:00'); |
| -shouldBeEqualToString('stepDown("17:00", 7200, "17:00", "20:00")', '19:00'); |
| -shouldBeEqualToString('stepUp("17:00", 7200, "17:00", "18:00")', '17:00'); |
| -shouldBeEqualToString('stepDown("17:00", 7200, "17:00", "18:00")', '17:00'); |
| - |
| -setDateTimeFormat(''); |
| -debug(''); |
| -document.body.removeChild(input); |
| + assert_input_value_after_up('11:00', 1, '12:00', '12:00'); |
| + assert_input_value_after_down('00:00', 1, '23:00', '23:00'); |
| + assert_input_value_after_up('23:00', 1, '00:00', '24:00'); |
| + assert_input_value_after_down('12:00', 1, '11:00', '11:00'); |
| + assert_input_value_with_limits_after_deleteup('06:00', 7200, null, null, '02:00'); |
| + assert_input_value_with_limits_after_deletedown('06:00', 7200, null, null, '00:00'); |
| + assert_input_value_with_limits_after_deleteup('06:00', 7200, '01:00', null, '01:00'); |
| + assert_input_value_with_limits_after_deletedown('06:00', 7200, '01:00', null, '23:00'); |
| + assert_input_value_with_limits_after_up('17:00', 1, '17:00', '20:00', '18:00'); |
| + assert_input_value_with_limits_after_down('17:00', 1, '17:00', '20:00', '20:00'); |
| + assert_input_value_with_limits_after_up('17:00', 1, '15:00', '17:00', '15:00'); |
| + assert_input_value_with_limits_after_down('17:00', 1, '15:00', '17:00', '16:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '17:00', '20:00', '17:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '17:00', '20:00', '20:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '13:00', '13:00', '13:00'); |
| + assert_input_value_with_limits_after_down('15:00', 1, '13:00', '13:00', '13:00'); |
| + assert_input_value_with_limits_after_up('00:00', 1, '00:00', '03:00', '01:00'); |
| + assert_input_value_with_limits_after_down('00:00', 1, '00:00', '03:00', '23:00'); |
| + assert_input_value_with_limits_after_up('03:00', 1, '00:00', '03:00', '04:00'); |
| + assert_input_value_with_limits_after_down('03:00', 1, '00:00', '03:00', '02:00'); |
| + assert_input_value_with_limits_after_up('12:00', 1, '10:00', '12:00', '10:00'); |
| + assert_input_value_with_limits_after_down('12:00', 1, '10:00', '12:00', '11:00'); |
| + assert_input_value_with_limits_after_up('00:00', 1, '00:00', '03:00', '01:00'); |
| + assert_input_value_with_limits_after_down('00:00', 1, '00:00', '03:00', '23:00'); |
| + assert_input_value_with_limits_after_up('15:00', 1, '10:00', '15:00', '10:00'); |
| + assert_input_value_with_limits_after_down('10:00', 1, '10:00', '15:00', '15:00'); |
| + assert_input_value_with_limits_after_up('17:00', 7200, '17:00', '20:00', '19:00'); |
| + assert_input_value_with_limits_after_down('17:00', 7200, '17:00', '20:00', '19:00'); |
| + assert_input_value_with_limits_after_up('17:00', 7200, '17:00', '18:00', '17:00'); |
| + assert_input_value_with_limits_after_down('17:00', 7200, '17:00', '18:00', '17:00'); |
| +}, 'Hours, 1-24'); |
| </script> |
| </body> |
| </html> |