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