| 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/common.js"></script> | |
| 6 <script src="../../../../../fast/forms/resources/picker-common.js"></script> | |
| 7 <script src="resources/calendar-picker-common.js"></script> | |
| 8 </head> | |
| 9 <body> | |
| 10 <p id="description"></p> | |
| 11 <div id="console"></div> | |
| 12 <input type=date id=date value="2000-01-02"> | |
| 13 <script> | |
| 14 description("Tests if calendar picker mouse operations work as expected."); | |
| 15 | |
| 16 debug('Check that page popup doesn\'t exist at first.'); | |
| 17 shouldBeNull('document.getElementById("mock-page-popup")'); | |
| 18 | |
| 19 openPicker(document.getElementById('date'), test); | |
| 20 | |
| 21 function test() { | |
| 22 debug('Open the month popup.'); | |
| 23 shouldBeFalse('popupWindow.global.picker.monthPopupView.isVisible'); | |
| 24 clickMonthPopupButton(); | |
| 25 shouldBeTrue('popupWindow.global.picker.monthPopupView.isVisible'); | |
| 26 | |
| 27 debug('Check that touch swiping scrolls the list in the month popup.'); | |
| 28 | |
| 29 window.internals.settings.setTouchEventEmulationEnabled(true); | |
| 30 checkYearListViewScrollOffset(); | |
| 31 | |
| 32 popupWindow.global.picker.monthPopupView.yearListView.element.addEventListen
er('touchend', testAfterSwipingDown, false); | |
| 33 hoverOverMonthButton(2000, 0); | |
| 34 eventSender.mouseDown(); | |
| 35 hoverOverMonthButton(2000, 11); | |
| 36 eventSender.mouseUp(); | |
| 37 } | |
| 38 | |
| 39 function testAfterSwipingDown() { | |
| 40 shouldBeTrue('checkYearListViewScrollOffset() > 0'); | |
| 41 popupWindow.global.picker.monthPopupView.yearListView.element.removeEventLis
tener('touchend', testAfterSwipingDown, false); | |
| 42 setTimeout(testSwipingUp, 0); | |
| 43 } | |
| 44 | |
| 45 function testSwipingUp() { | |
| 46 checkYearListViewScrollOffset(); | |
| 47 popupWindow.global.picker.monthPopupView.yearListView.element.addEventListen
er('touchend', testAfterSwipingUp, false); | |
| 48 eventSender.mouseDown(); | |
| 49 hoverOverMonthPopupButton(); | |
| 50 eventSender.mouseUp(); | |
| 51 } | |
| 52 | |
| 53 function testAfterSwipingUp() { | |
| 54 shouldBeTrue('checkYearListViewScrollOffset() < 0'); | |
| 55 popupWindow.global.picker.monthPopupView.yearListView.element.removeEventLis
tener('touchend', testAfterSwipingUp, false); | |
| 56 window.internals.settings.setTouchEventEmulationEnabled(false); | |
| 57 finishJSTest(); | |
| 58 } | |
| 59 </script> | |
| 60 <script src="../../../../../fast/js/resources/js-test-post.js"></script> | |
| 61 </body> | |
| 62 </html> | |
| OLD | NEW |