| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../../../../fast/js/resources/js-test-pre.js"></script> | |
| 5 <script src="../../../../../fast/forms/resources/picker-common.js"></script> | |
| 6 <script src="resources/calendar-picker-common.js"></script> | |
| 7 </head> | |
| 8 <body> | |
| 9 <p id="description"></p> | |
| 10 <div id="console"></div> | |
| 11 | |
| 12 <input type=datetime id=datetime value="2012-11-20T00:00Z" step="302400"/> | |
| 13 | |
| 14 <script> | |
| 15 description('Test if step limits available dates in calendar picker on datetime
input.'); | |
| 16 | |
| 17 openPicker(document.getElementById('datetime'), test1); | |
| 18 | |
| 19 function test1() { | |
| 20 debug("Step without min or max."); | |
| 21 shouldBeEqualToString('availableDayCells().join(",")', '2012-11-01,2012-11-0
4,2012-11-08,2012-11-11,2012-11-15,2012-11-18,2012-11-22,2012-11-25,2012-11-29')
; | |
| 22 | |
| 23 // Close popup | |
| 24 eventSender.keyDown('\x1B'); | |
| 25 waitUntilClosing(test1AfterClose); | |
| 26 } | |
| 27 | |
| 28 function test1AfterClose() { | |
| 29 document.getElementById('datetime').min = "2012-11-16T12:00Z"; | |
| 30 | |
| 31 // Reopen popup | |
| 32 openPicker(document.getElementById('datetime'), test2); | |
| 33 } | |
| 34 | |
| 35 function test2() { | |
| 36 debug("Step when min is set."); | |
| 37 shouldBeEqualToString('availableDayCells().join(",")', '2012-11-16,2012-11-2
0,2012-11-23,2012-11-27,2012-11-30'); | |
| 38 | |
| 39 // Close popup | |
| 40 eventSender.keyDown('\x1B'); | |
| 41 waitUntilClosing(test2AfterClose); | |
| 42 } | |
| 43 | |
| 44 function test2AfterClose() { | |
| 45 document.getElementById('datetime').max = "2012-11-20T00:00Z"; | |
| 46 | |
| 47 // Reopen popup | |
| 48 openPicker(document.getElementById('datetime'), test3); | |
| 49 } | |
| 50 | |
| 51 function test3() { | |
| 52 debug("Step when min and max are set."); | |
| 53 shouldBeEqualToString('availableDayCells().join(",")', '2012-11-16,2012-11-2
0'); | |
| 54 finishJSTest(); | |
| 55 } | |
| 56 | |
| 57 </script> | |
| 58 <script src="../../../../../fast/js/resources/js-test-post.js"></script> | |
| 59 </body> | |
| 60 </html> | |
| OLD | NEW |