| 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/picker-common.js"></script> | 5 <script src="../../forms/resources/picker-common.js"></script> |
| 6 <script src="resources/calendar-picker-common.js"></script> | 6 <script src="resources/calendar-picker-common.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <p id="description"></p> | 9 <p id="description"></p> |
| 10 <div id="console"></div> | 10 <div id="console"></div> |
| 11 <input type=date id=date value="2000-01-02"> | 11 <input type=date id=date value="2000-01-02"> |
| 12 <script> | 12 <script> |
| 13 description("Tests if calendar picker key bindings work as expected."); | 13 description("Tests if calendar picker key bindings work as expected."); |
| 14 | 14 |
| 15 debug('Check that page popup doesn\'t exist at first.'); | 15 debug('Check that page popup doesn\'t exist at first.'); |
| 16 shouldBeNull('document.getElementById("mock-page-popup")'); | 16 shouldBeNull('document.getElementById("mock-page-popup")'); |
| 17 | 17 |
| 18 openPicker(document.getElementById('date'), test1); | 18 openPicker(document.getElementById('date'), test1); |
| 19 | 19 |
| 20 function test1() { | 20 function test1() { |
| 21 debug('Check that page popup exists.'); | 21 debug('Check that page popup exists.'); |
| 22 shouldBe('popupWindow.pagePopupController.toString()', '"[object PagePopupCo
ntroller]"'); | 22 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object
PagePopupController]'); |
| 23 | 23 |
| 24 shouldBeFalse('isCalendarTableScrollingWithAnimation()'); | 24 shouldBeFalse('isCalendarTableScrollingWithAnimation()'); |
| 25 shouldBeEqualToString('currentMonth()', '2000-01'); | 25 shouldBeEqualToString('currentMonth()', '2000-01'); |
| 26 shouldBeEqualToString('selectedValue()', '2000-01-02'); | 26 shouldBeEqualToString('selectedValue()', '2000-01-02'); |
| 27 shouldBeEqualToString('selectedDayCells()', '2000-01-02'); | 27 shouldBeEqualToString('selectedDayCells()', '2000-01-02'); |
| 28 shouldBeEqualToString('highlightedValue()', '2000-01-02'); | 28 shouldBeEqualToString('highlightedValue()', '2000-01-02'); |
| 29 shouldBeEqualToString('highlightedDayCells()', '2000-01-02'); | 29 shouldBeEqualToString('highlightedDayCells()', '2000-01-02'); |
| 30 | 30 |
| 31 debug('Check that arrow keys work properly even when going between weeks and
months.'); | 31 debug('Check that arrow keys work properly even when going between weeks and
months.'); |
| 32 | 32 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 debug("focus calendar table"); | 238 debug("focus calendar table"); |
| 239 popupWindow.global.picker.calendarTableView.element.focus(); | 239 popupWindow.global.picker.calendarTableView.element.focus(); |
| 240 | 240 |
| 241 setNoCloseOnCommit(); | 241 setNoCloseOnCommit(); |
| 242 // Test twice in case midnight. | 242 // Test twice in case midnight. |
| 243 debug("press t"); | 243 debug("press t"); |
| 244 shouldBeTrue('testToday() || testToday()'); | 244 shouldBeTrue('testToday() || testToday()'); |
| 245 | 245 |
| 246 debug("press esc"); | 246 debug("press esc"); |
| 247 eventSender.keyDown('\x1B'); | 247 eventSender.keyDown('escape'); |
| 248 waitUntilClosing(test2AfterClosing); | 248 waitUntilClosing(test2AfterClosing); |
| 249 } | 249 } |
| 250 | 250 |
| 251 function test2AfterClosing() { | 251 function test2AfterClosing() { |
| 252 shouldBeNull('document.getElementById("mock-page-popup")'); | 252 shouldBeNull('document.getElementById("mock-page-popup")'); |
| 253 | 253 |
| 254 finishJSTest(); | 254 finishJSTest(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 function testToday() { | 257 function testToday() { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 279 return null; | 279 return null; |
| 280 var identifier = "." + element.className; | 280 var identifier = "." + element.className; |
| 281 if (element.value) | 281 if (element.value) |
| 282 identifier += "[value=" + element.value + "]"; | 282 identifier += "[value=" + element.value + "]"; |
| 283 return identifier; | 283 return identifier; |
| 284 } | 284 } |
| 285 | 285 |
| 286 </script> | 286 </script> |
| 287 </body> | 287 </body> |
| 288 </html> | 288 </html> |
| OLD | NEW |