Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: LayoutTests/fast/forms/calendar-picker/calendar-picker-key-operations.html

Issue 629103002: Don't use mock PagePopup if possible. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/calendar-picker-common.js"></script> 6 <script src="resources/calendar-picker-common.js"></script>
7 </head> 7 </head>
8 <body> 8 <body>
9 <p id="description"></p> 9 <p id="description"></p>
10 <div id="console"></div> 10 <div id="console"></div>
11 <input type=date id=date value="2000-01-02"> 11 <input type=date id=date value="2000-01-02">
12 <script> 12 <script>
13 description("Tests if calendar picker key bindings work as expected."); 13 description("Tests if calendar picker key bindings work as expected.");
14 14
15 debug('Check that page popup doesn\'t exist at first.'); 15 debug('Check that page popup doesn\'t exist at first.');
16 shouldBeNull('document.getElementById("mock-page-popup")'); 16 shouldBeNull('document.getElementById("mock-page-popup")');
17 17
18 openPickerWithMock(document.getElementById('date'), test1); 18 openPicker(document.getElementById('date'), test1);
19 19
20 function test1() { 20 function test1() {
21 debug('Check that page popup exists.'); 21 debug('Check that page popup exists.');
22 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object PagePopupController]'); 22 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object PagePopupController]');
23 23
24 shouldBeFalse('isCalendarTableScrollingWithAnimation()'); 24 shouldBeFalse('isCalendarTableScrollingWithAnimation()');
25 shouldBeEqualToString('currentMonth()', '2000-01'); 25 shouldBeEqualToString('currentMonth()', '2000-01');
26 shouldBeEqualToString('selectedValue()', '2000-01-02'); 26 shouldBeEqualToString('selectedValue()', '2000-01-02');
27 shouldBeEqualToString('selectedDayCells()', '2000-01-02'); 27 shouldBeEqualToString('selectedDayCells()', '2000-01-02');
28 shouldBeEqualToString('highlightedValue()', '2000-01-02'); 28 shouldBeEqualToString('highlightedValue()', '2000-01-02');
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 shouldBeEqualToString('selectedValue()', '2000-01-02'); 158 shouldBeEqualToString('selectedValue()', '2000-01-02');
159 shouldBeEqualToString('selectedDayCells()', ''); 159 shouldBeEqualToString('selectedDayCells()', '');
160 shouldBeEqualToString('highlightedValue()', '1999-12-26'); 160 shouldBeEqualToString('highlightedValue()', '1999-12-26');
161 shouldBeEqualToString('highlightedDayCells()', '1999-12-26'); 161 shouldBeEqualToString('highlightedDayCells()', '1999-12-26');
162 162
163 debug("press enter"); 163 debug("press enter");
164 removeCommitDelay(); 164 removeCommitDelay();
165 eventSender.keyDown('\n'); 165 eventSender.keyDown('\n');
166 shouldBeEqualToString('document.getElementById("date").value', '1999-12-26') ; 166 shouldBeEqualToString('document.getElementById("date").value', '1999-12-26') ;
167 waitUntilClosing(function() { 167 waitUntilClosing(function() {
168 openPickerWithMock(document.getElementById("date"), test2); 168 openPicker(document.getElementById("date"), test2);
169 }); 169 });
170 } 170 }
171 171
172 function test2() { 172 function test2() {
173 debug('Check if tabbing works.'); 173 debug('Check if tabbing works.');
174 shouldBeEqualToString('focusedElement()', '.list-view calendar-table-view'); 174 shouldBeEqualToString('focusedElement()', '.list-view calendar-table-view');
175 eventSender.keyDown('\t', ['shiftKey']); 175 eventSender.keyDown('\t', ['shiftKey']);
176 shouldBeEqualToString('focusedElement()', '.calendar-navigation-button'); 176 shouldBeEqualToString('focusedElement()', '.calendar-navigation-button');
177 eventSender.keyDown('\t', ['shiftKey']); 177 eventSender.keyDown('\t', ['shiftKey']);
178 shouldBeEqualToString('focusedElement()', '.calendar-navigation-button today -button'); 178 shouldBeEqualToString('focusedElement()', '.calendar-navigation-button today -button');
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 if (element.className) 300 if (element.className)
301 identifier += "." + element.className.replace(/ +/g, "."); 301 identifier += "." + element.className.replace(/ +/g, ".");
302 if (element.value) 302 if (element.value)
303 identifier += "[value=" + element.value + "]"; 303 identifier += "[value=" + element.value + "]";
304 return identifier; 304 return identifier;
305 } 305 }
306 306
307 </script> 307 </script>
308 </body> 308 </body>
309 </html> 309 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698