| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 <option>2012-03-08</option> | 80 <option>2012-03-08</option> |
| 81 <option>2012-01-00</option> <!--invalid--> | 81 <option>2012-01-00</option> <!--invalid--> |
| 82 <option>foo</option> <!--invalid--> | 82 <option>foo</option> <!--invalid--> |
| 83 </datalist> | 83 </datalist> |
| 84 <script> | 84 <script> |
| 85 description("Tests that key bindings work as expected."); | 85 description("Tests that key bindings work as expected."); |
| 86 | 86 |
| 87 debug('Check that page popup doesn\'t exist at first.'); | 87 debug('Check that page popup doesn\'t exist at first.'); |
| 88 shouldBeNull('document.getElementById("mock-page-popup")'); | 88 shouldBeNull('document.getElementById("mock-page-popup")'); |
| 89 | 89 |
| 90 openPicker(document.getElementById('date'), test1); | 90 openPickerWithMock(document.getElementById('date'), test1); |
| 91 | 91 |
| 92 var expectingDidHideEvent = false; | 92 var expectingDidHideEvent = false; |
| 93 | 93 |
| 94 function test1() { | 94 function test1() { |
| 95 debug('Check that page popup exists.'); | 95 debug('Check that page popup exists.'); |
| 96 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object
PagePopupController]'); | 96 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object
PagePopupController]'); |
| 97 popupWindow.focus(); | 97 popupWindow.focus(); |
| 98 | 98 |
| 99 debug('Check that up/down arrow keys work.'); | 99 debug('Check that up/down arrow keys work.'); |
| 100 shouldBeNull('highlightedEntry()'); | 100 shouldBeNull('highlightedEntry()'); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 shouldBeEqualToString('highlightedEntry()', '2012-03-08'); | 132 shouldBeEqualToString('highlightedEntry()', '2012-03-08'); |
| 133 eventSender.keyDown("\n"); | 133 eventSender.keyDown("\n"); |
| 134 waitUntilClosing(test1AfterClosing); | 134 waitUntilClosing(test1AfterClosing); |
| 135 } | 135 } |
| 136 | 136 |
| 137 function test1AfterClosing() { | 137 function test1AfterClosing() { |
| 138 shouldBeNull('document.getElementById("mock-page-popup")'); | 138 shouldBeNull('document.getElementById("mock-page-popup")'); |
| 139 shouldBeEqualToString('document.getElementById("date").value', '2012-03-08')
; | 139 shouldBeEqualToString('document.getElementById("date").value', '2012-03-08')
; |
| 140 | 140 |
| 141 debug('Reopen popup.'); | 141 debug('Reopen popup.'); |
| 142 openPicker(document.getElementById('date'), test2); | 142 openPickerWithMock(document.getElementById('date'), test2); |
| 143 } | 143 } |
| 144 | 144 |
| 145 function test2() { | 145 function test2() { |
| 146 popupWindow.focus(); | 146 popupWindow.focus(); |
| 147 | 147 |
| 148 eventSender.keyDown('pageDown'); | 148 eventSender.keyDown('pageDown'); |
| 149 eventSender.keyDown('pageDown'); | 149 eventSender.keyDown('pageDown'); |
| 150 eventSender.keyDown('pageDown'); | 150 eventSender.keyDown('pageDown'); |
| 151 shouldBeEqualToString('highlightedEntry()', '@openCalendarPicker'); | 151 shouldBeEqualToString('highlightedEntry()', '@openCalendarPicker'); |
| 152 | 152 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 sendKey(document.getElementById('date'), "F4"); | 184 sendKey(document.getElementById('date'), "F4"); |
| 185 if (document.getElementById('mock-page-popup')) | 185 if (document.getElementById('mock-page-popup')) |
| 186 testPassed("F4 opened picker."); | 186 testPassed("F4 opened picker."); |
| 187 | 187 |
| 188 finishJSTest(); | 188 finishJSTest(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 </script> | 191 </script> |
| 192 </body> | 192 </body> |
| 193 </html> | 193 </html> |
| OLD | NEW |