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

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

Issue 633823003: Don't use mock PagePopup if possible, part 2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase again 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/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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 <option>2012-00</option> <!--invalid--> 73 <option>2012-00</option> <!--invalid-->
74 <option>2012-01-01</option> <!--invalid--> 74 <option>2012-01-01</option> <!--invalid-->
75 <option>foo</option> <!--invalid--> 75 <option>foo</option> <!--invalid-->
76 </datalist> 76 </datalist>
77 <script> 77 <script>
78 description("Tests that key bindings work as expected."); 78 description("Tests that key bindings work as expected.");
79 79
80 debug('Check that page popup doesn\'t exist at first.'); 80 debug('Check that page popup doesn\'t exist at first.');
81 shouldBeNull('document.getElementById("mock-page-popup")'); 81 shouldBeNull('document.getElementById("mock-page-popup")');
82 82
83 openPickerWithMock(document.getElementById('month'), test1); 83 openPicker(document.getElementById('month'), test1);
84 84
85 var expectingDidHideEvent = false; 85 var expectingDidHideEvent = false;
86 86
87 function test1() { 87 function test1() {
88 debug('Check that page popup exists.'); 88 debug('Check that page popup exists.');
89 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object PagePopupController]'); 89 shouldBeEqualToString('popupWindow.pagePopupController.toString()', '[object PagePopupController]');
90 popupWindow.focus(); 90 popupWindow.focus();
91 91
92 debug('Check that up/down arrow keys work.'); 92 debug('Check that up/down arrow keys work.');
93 shouldBeNull('highlightedEntry()'); 93 shouldBeNull('highlightedEntry()');
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 shouldBeEqualToString('highlightedEntry()', '2016-12'); 125 shouldBeEqualToString('highlightedEntry()', '2016-12');
126 eventSender.keyDown("\n"); 126 eventSender.keyDown("\n");
127 waitUntilClosing(test1AfterClosing); 127 waitUntilClosing(test1AfterClosing);
128 } 128 }
129 129
130 function test1AfterClosing() { 130 function test1AfterClosing() {
131 shouldBeNull('document.getElementById("mock-page-popup")'); 131 shouldBeNull('document.getElementById("mock-page-popup")');
132 shouldBeEqualToString('document.getElementById("month").value', '2016-12'); 132 shouldBeEqualToString('document.getElementById("month").value', '2016-12');
133 133
134 debug('Reopen popup.'); 134 debug('Reopen popup.');
135 openPickerWithMock(document.getElementById('month'), test2); 135 openPicker(document.getElementById('month'), test2);
136 } 136 }
137 137
138 function test2() { 138 function test2() {
139 popupWindow.focus(); 139 popupWindow.focus();
140 140
141 eventSender.keyDown('pageDown'); 141 eventSender.keyDown('pageDown');
142 eventSender.keyDown('pageDown'); 142 eventSender.keyDown('pageDown');
143 eventSender.keyDown('pageDown'); 143 eventSender.keyDown('pageDown');
144 shouldBeEqualToString('highlightedEntry()', '@openCalendarPicker'); 144 shouldBeEqualToString('highlightedEntry()', '@openCalendarPicker');
145 145
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 sendKey(document.getElementById('month'), "F4"); 177 sendKey(document.getElementById('month'), "F4");
178 if (document.getElementById('mock-page-popup')) 178 if (document.getElementById('mock-page-popup'))
179 testPassed("F4 opened picker."); 179 testPassed("F4 opened picker.");
180 180
181 finishJSTest(); 181 finishJSTest();
182 } 182 }
183 183
184 </script> 184 </script>
185 </body> 185 </body>
186 </html> 186 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698