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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 <option>2012-11-22T02:03</option> | 75 <option>2012-11-22T02:03</option> |
76 <option>2012-11-22T02:04</option> | 76 <option>2012-11-22T02:04</option> |
77 <option>2012-11-22T02:05</option> | 77 <option>2012-11-22T02:05</option> |
78 <option>2012-11-22T02:06</option> | 78 <option>2012-11-22T02:06</option> |
79 <option>2012-11-22T02:07</option> | 79 <option>2012-11-22T02:07</option> |
80 </datalist> | 80 </datalist> |
81 <script> | 81 <script> |
82 debug('Check that page popup doesn\'t exist at first.'); | 82 debug('Check that page popup doesn\'t exist at first.'); |
83 shouldBeNull('document.getElementById("mock-page-popup")'); | 83 shouldBeNull('document.getElementById("mock-page-popup")'); |
84 | 84 |
85 openPickerWithMock(document.getElementById('datetime-local'), test1); | 85 openPicker(document.getElementById('datetime-local'), test1); |
86 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object Pag
ePopupController]'); | 86 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object Pag
ePopupController]'); |
87 | 87 |
88 function test1() { | 88 function test1() { |
89 debug('Check that page popup exists.'); | 89 debug('Check that page popup exists.'); |
90 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object
PagePopupController]'); | 90 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object
PagePopupController]'); |
91 popupWindow.focus(); | 91 popupWindow.focus(); |
92 | 92 |
93 popupWindow.removeEventListener('resize', test1, false); | 93 popupWindow.removeEventListener('resize', test1, false); |
94 | 94 |
95 debug('Check that up/down arrow keys work.'); | 95 debug('Check that up/down arrow keys work.'); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 shouldBeEqualToString('highlightedEntry()', '2012-11-22T02:07'); | 128 shouldBeEqualToString('highlightedEntry()', '2012-11-22T02:07'); |
129 eventSender.keyDown('\n'); | 129 eventSender.keyDown('\n'); |
130 waitUntilClosing(test1AfterClosing); | 130 waitUntilClosing(test1AfterClosing); |
131 } | 131 } |
132 | 132 |
133 function test1AfterClosing() { | 133 function test1AfterClosing() { |
134 shouldBeNull('document.getElementById("mock-page-popup")'); | 134 shouldBeNull('document.getElementById("mock-page-popup")'); |
135 shouldBeEqualToString('document.getElementById("datetime-local").value', '20
12-11-22T02:07'); | 135 shouldBeEqualToString('document.getElementById("datetime-local").value', '20
12-11-22T02:07'); |
136 | 136 |
137 debug('Reopen popup.'); | 137 debug('Reopen popup.'); |
138 openPickerWithMock(document.getElementById('datetime-local')); | 138 openPicker(document.getElementById('datetime-local')); |
139 popupWindow.addEventListener('resize', test2, false); | 139 popupWindow.addEventListener('resize', test2, false); |
140 } | 140 } |
141 | 141 |
142 function test2() { | 142 function test2() { |
143 popupWindow.removeEventListener('resize', test2, false); | 143 popupWindow.removeEventListener('resize', test2, false); |
144 | 144 |
145 popupWindow.focus(); | 145 popupWindow.focus(); |
146 | 146 |
147 debug('Check that escape key closes the popup.'); | 147 debug('Check that escape key closes the popup.'); |
148 eventSender.keyDown('escape'); | 148 eventSender.keyDown('escape'); |
149 waitUntilClosing(test2AfterClosing); | 149 waitUntilClosing(test2AfterClosing); |
150 } | 150 } |
151 | 151 |
152 function test2AfterClosing() { | 152 function test2AfterClosing() { |
153 shouldBeNull('document.getElementById("mock-page-popup")'); | 153 shouldBeNull('document.getElementById("mock-page-popup")'); |
154 shouldBeEqualToString('document.getElementById("datetime-local").value', '20
12-11-22T02:07'); | 154 shouldBeEqualToString('document.getElementById("datetime-local").value', '20
12-11-22T02:07'); |
155 | 155 |
156 sendKey(document.getElementById('datetime-local'), 'F4'); | 156 sendKey(document.getElementById('datetime-local'), 'F4'); |
157 if (document.getElementById('mock-page-popup')) | 157 if (document.getElementById('mock-page-popup')) |
158 testPassed('F4 opened picker.'); | 158 testPassed('F4 opened picker.'); |
159 | 159 |
160 finishJSTest(); | 160 finishJSTest(); |
161 } | 161 } |
162 | 162 |
163 </script> | 163 </script> |
164 </body> | 164 </body> |
165 </html> | 165 </html> |
OLD | NEW |