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