| 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="../../forms/resources/common.js"></script> | 5 <script src="../../forms/resources/common.js"></script> |
| 6 <script src="../../forms/resources/picker-common.js"></script> | 6 <script src="../../forms/resources/picker-common.js"></script> |
| 7 <script src="resources/calendar-picker-common.js"></script> | 7 <script src="resources/calendar-picker-common.js"></script> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <input type=date id=date value="2000-01-02"> | 10 <input type=date id=date value="2000-01-02"> |
| 11 <p id="description"></p> | 11 <p id="description"></p> |
| 12 <div id="console"></div> | 12 <div id="console"></div> |
| 13 <script> | 13 <script> |
| 14 description("Tests if calendar picker mouse opearations work as expected."); | 14 description("Tests if calendar picker mouse opearations work as expected."); |
| 15 | 15 |
| 16 debug('Check that page popup doesn\'t exist at first.'); | 16 debug('Check that page popup doesn\'t exist at first.'); |
| 17 shouldBeNull('document.getElementById("mock-page-popup")'); | 17 shouldBeNull('document.getElementById("mock-page-popup")'); |
| 18 | 18 |
| 19 openPicker(document.getElementById('date'), test); | 19 openPickerWithMock(document.getElementById('date'), test); |
| 20 | 20 |
| 21 function test() { | 21 function test() { |
| 22 shouldBeEqualToString('currentMonth()', '2000-01'); | 22 shouldBeEqualToString('currentMonth()', '2000-01'); |
| 23 shouldBeEqualToString('selectedValue()', '2000-01-02'); | 23 shouldBeEqualToString('selectedValue()', '2000-01-02'); |
| 24 shouldBeEqualToString('selectedDayCells()', '2000-01-02'); | 24 shouldBeEqualToString('selectedDayCells()', '2000-01-02'); |
| 25 shouldBeEqualToString('highlightedValue()', '2000-01-02'); | 25 shouldBeEqualToString('highlightedValue()', '2000-01-02'); |
| 26 shouldBeEqualToString('highlightedDayCells()', '2000-01-02'); | 26 shouldBeEqualToString('highlightedDayCells()', '2000-01-02'); |
| 27 | 27 |
| 28 debug('Check that hovering over an entry highlights it.'); | 28 debug('Check that hovering over an entry highlights it.'); |
| 29 hoverOverDayCellAt(5, 0); | 29 hoverOverDayCellAt(5, 0); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 47 shouldBeEqualToString('selectedDayCells()', ''); | 47 shouldBeEqualToString('selectedDayCells()', ''); |
| 48 shouldBeEqualToString('highlightedValue()', '2000-02-08'); | 48 shouldBeEqualToString('highlightedValue()', '2000-02-08'); |
| 49 shouldBeEqualToString('highlightedDayCells()', '2000-02-08'); | 49 shouldBeEqualToString('highlightedDayCells()', '2000-02-08'); |
| 50 | 50 |
| 51 debug('Check that mouse click sets the value.'); | 51 debug('Check that mouse click sets the value.'); |
| 52 removeCommitDelay(); | 52 removeCommitDelay(); |
| 53 clickDayCellAt(6, 0); | 53 clickDayCellAt(6, 0); |
| 54 shouldBeEqualToString('document.getElementById("date").value', '2000-02-05')
; | 54 shouldBeEqualToString('document.getElementById("date").value', '2000-02-05')
; |
| 55 | 55 |
| 56 waitUntilClosing(function() { | 56 waitUntilClosing(function() { |
| 57 openPicker(document.getElementById('date'), test2); | 57 openPickerWithMock(document.getElementById('date'), test2); |
| 58 }); | 58 }); |
| 59 } | 59 } |
| 60 | 60 |
| 61 function test2() { | 61 function test2() { |
| 62 debug('Check that clicking the month popup button opens the month popup.'); | 62 debug('Check that clicking the month popup button opens the month popup.'); |
| 63 shouldBeFalse('popupWindow.global.picker.monthPopupView.isVisible'); | 63 shouldBeFalse('popupWindow.global.picker.monthPopupView.isVisible'); |
| 64 clickMonthPopupButton(); | 64 clickMonthPopupButton(); |
| 65 shouldBeTrue('popupWindow.global.picker.monthPopupView.isVisible'); | 65 shouldBeTrue('popupWindow.global.picker.monthPopupView.isVisible'); |
| 66 shouldBeEqualToString('highlightedMonthButton()', '2000-02'); | 66 shouldBeEqualToString('highlightedMonthButton()', '2000-02'); |
| 67 checkYearListViewScrollOffset(); | 67 checkYearListViewScrollOffset(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 89 | 89 |
| 90 clickMonthButton(1999, 5); | 90 clickMonthButton(1999, 5); |
| 91 shouldBeFalse('popupWindow.global.picker.monthPopupView.isVisible'); | 91 shouldBeFalse('popupWindow.global.picker.monthPopupView.isVisible'); |
| 92 shouldBeEqualToString('currentMonth()', '1999-06'); | 92 shouldBeEqualToString('currentMonth()', '1999-06'); |
| 93 | 93 |
| 94 finishJSTest(); | 94 finishJSTest(); |
| 95 } | 95 } |
| 96 </script> | 96 </script> |
| 97 </body> | 97 </body> |
| 98 </html> | 98 </html> |
| OLD | NEW |