| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 <script src="../resources/common.js"></script> | 5 <script src="../resources/common.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <script> | 8 <script> |
| 9 description('Check stepping-up and -down for datetime-local input fields from re
nderer.'); | 9 description('Check stepping-up and -down for datetime-local input fields from re
nderer.'); |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 function test(value, step, min, max, keySequence) { | 29 function test(value, step, min, max, keySequence) { |
| 30 setInputAttributes(value, min, max, step); | 30 setInputAttributes(value, min, max, step); |
| 31 for (var i = 0; i < keySequence.length; i++) | 31 for (var i = 0; i < keySequence.length; i++) |
| 32 keyDown(keySequence[i]); | 32 keyDown(keySequence[i]); |
| 33 return input.value; | 33 return input.value; |
| 34 } | 34 } |
| 35 | 35 |
| 36 function stepUp(value, step, min, max) { | 36 function stepUp(value, step, min, max) { |
| 37 return test(value, step, min, max, ['upArrow']); | 37 return test(value, step, min, max, ['ArrowUp']); |
| 38 } | 38 } |
| 39 | 39 |
| 40 function stepDown(value, step, min, max) { | 40 function stepDown(value, step, min, max) { |
| 41 return test(value, step, min, max, ['downArrow']); | 41 return test(value, step, min, max, ['ArrowDown']); |
| 42 } | 42 } |
| 43 | 43 |
| 44 input.type = 'datetime-local'; | 44 input.type = 'datetime-local'; |
| 45 input.focus(); | 45 input.focus(); |
| 46 debug('Function arguments are (value, step, min, max, [keySequence]).'); | 46 debug('Function arguments are (value, step, min, max, [keySequence]).'); |
| 47 debug('The hour field respects min/max attributes when they have the same date.'
); | 47 debug('The hour field respects min/max attributes when they have the same date.'
); |
| 48 keyDown('rightArrow'); | 48 keyDown('ArrowRight'); |
| 49 keyDown('rightArrow'); | 49 keyDown('ArrowRight'); |
| 50 keyDown('rightArrow'); | 50 keyDown('ArrowRight'); |
| 51 shouldBeEqualToString('stepUp("2013-01-16T17:00", 1, "2013-01-16T15:00", "2013-0
1-16T17:00")', '2013-01-16T15:00'); | 51 shouldBeEqualToString('stepUp("2013-01-16T17:00", 1, "2013-01-16T15:00", "2013-0
1-16T17:00")', '2013-01-16T15:00'); |
| 52 shouldBeEqualToString('stepDown("2013-01-16T15:00", 1, "2013-01-16T15:00", "2013
-01-16T17:00")', '2013-01-16T17:00'); | 52 shouldBeEqualToString('stepDown("2013-01-16T15:00", 1, "2013-01-16T15:00", "2013
-01-16T17:00")', '2013-01-16T17:00'); |
| 53 shouldBeEqualToString('stepUp("2013-01-16T17:00", 1, "2013-01-16T15:00", "2013-0
1-17T17:00")', '2013-01-16T18:00'); | 53 shouldBeEqualToString('stepUp("2013-01-16T17:00", 1, "2013-01-16T15:00", "2013-0
1-17T17:00")', '2013-01-16T18:00'); |
| 54 shouldBeEqualToString('stepDown("2013-01-16T17:00", 1, "2013-01-16T17:00", "2013
-01-17T20:00")', '2013-01-16T16:00'); | 54 shouldBeEqualToString('stepDown("2013-01-16T17:00", 1, "2013-01-16T17:00", "2013
-01-17T20:00")', '2013-01-16T16:00'); |
| 55 | 55 |
| 56 debug(''); | 56 debug(''); |
| 57 document.body.removeChild(input); | 57 document.body.removeChild(input); |
| 58 </script> | 58 </script> |
| 59 </body> | 59 </body> |
| 60 </html> | 60 </html> |
| OLD | NEW |