| 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/suggestion-picker-common.js"></script> | 6 <script src="resources/suggestion-picker-common.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body style="background-color: #bbbbbb;"> | 8 <body style="background-color: #bbbbbb;"> |
| 9 <p id="description"></p> | 9 <p id="description"></p> |
| 10 <div id="console"></div> | 10 <div id="console"></div> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 <option>2012-00</option> <!--invalid--> | 73 <option>2012-00</option> <!--invalid--> |
| 74 <option>2012-01-01</option> <!--invalid--> | 74 <option>2012-01-01</option> <!--invalid--> |
| 75 <option>foo</option> <!--invalid--> | 75 <option>foo</option> <!--invalid--> |
| 76 </datalist> | 76 </datalist> |
| 77 <script> | 77 <script> |
| 78 description("Tests that key bindings work as expected."); | 78 description("Tests that key bindings work as expected."); |
| 79 | 79 |
| 80 debug('Check that page popup doesn\'t exist at first.'); | 80 debug('Check that page popup doesn\'t exist at first.'); |
| 81 shouldBeNull('document.getElementById("mock-page-popup")'); | 81 shouldBeNull('document.getElementById("mock-page-popup")'); |
| 82 | 82 |
| 83 openPickerWithMock(document.getElementById('month'), test1); | 83 openPicker(document.getElementById('month'), test1); |
| 84 | 84 |
| 85 var expectingDidHideEvent = false; | 85 var expectingDidHideEvent = false; |
| 86 | 86 |
| 87 function test1() { | 87 function test1() { |
| 88 debug('Check that page popup exists.'); | 88 debug('Check that page popup exists.'); |
| 89 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object
PagePopupController]'); | 89 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object
PagePopupController]'); |
| 90 popupWindow.focus(); | 90 popupWindow.focus(); |
| 91 | 91 |
| 92 debug('Check that up/down arrow keys work.'); | 92 debug('Check that up/down arrow keys work.'); |
| 93 shouldBeNull('highlightedEntry()'); | 93 shouldBeNull('highlightedEntry()'); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 shouldBeEqualToString('highlightedEntry()', '2016-12'); | 125 shouldBeEqualToString('highlightedEntry()', '2016-12'); |
| 126 eventSender.keyDown("\n"); | 126 eventSender.keyDown("\n"); |
| 127 waitUntilClosing(test1AfterClosing); | 127 waitUntilClosing(test1AfterClosing); |
| 128 } | 128 } |
| 129 | 129 |
| 130 function test1AfterClosing() { | 130 function test1AfterClosing() { |
| 131 shouldBeNull('document.getElementById("mock-page-popup")'); | 131 shouldBeNull('document.getElementById("mock-page-popup")'); |
| 132 shouldBeEqualToString('document.getElementById("month").value', '2016-12'); | 132 shouldBeEqualToString('document.getElementById("month").value', '2016-12'); |
| 133 | 133 |
| 134 debug('Reopen popup.'); | 134 debug('Reopen popup.'); |
| 135 openPickerWithMock(document.getElementById('month'), test2); | 135 openPicker(document.getElementById('month'), test2); |
| 136 } | 136 } |
| 137 | 137 |
| 138 function test2() { | 138 function test2() { |
| 139 popupWindow.focus(); | 139 popupWindow.focus(); |
| 140 | 140 |
| 141 eventSender.keyDown('pageDown'); | 141 eventSender.keyDown('pageDown'); |
| 142 eventSender.keyDown('pageDown'); | 142 eventSender.keyDown('pageDown'); |
| 143 eventSender.keyDown('pageDown'); | 143 eventSender.keyDown('pageDown'); |
| 144 shouldBeEqualToString('highlightedEntry()', '@openCalendarPicker'); | 144 shouldBeEqualToString('highlightedEntry()', '@openCalendarPicker'); |
| 145 | 145 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 sendKey(document.getElementById('month'), "F4"); | 177 sendKey(document.getElementById('month'), "F4"); |
| 178 if (document.getElementById('mock-page-popup')) | 178 if (document.getElementById('mock-page-popup')) |
| 179 testPassed("F4 opened picker."); | 179 testPassed("F4 opened picker."); |
| 180 | 180 |
| 181 finishJSTest(); | 181 finishJSTest(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 </script> | 184 </script> |
| 185 </body> | 185 </body> |
| 186 </html> | 186 </html> |
| OLD | NEW |