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

Side by Side Diff: LayoutTests/fast/forms/calendar-picker/date-open-picker-with-f4-key.html

Issue 1311013012: date/time inputs should not handle keyboard events if they aren't focused. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update *-open-picker-with-f4-key.html Created 5 years, 3 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="resources/calendar-picker-common.js"></script> 5 <script src="resources/calendar-picker-common.js"></script>
6 </head> 6 </head>
7 <body> 7 <body>
8 <p id="description"></p> 8 <p id="description"></p>
9 <div id="console"></div> 9 <div id="console"></div>
10 <input type=date id=test> 10 <input type=date id=test>
11 <script> 11 <script>
12 description("Tests if pressing F4 opens the calendar picker."); 12 description("Tests if pressing F4 opens the calendar picker.");
13 13
14 debug('Check that page popup doesn\'t exist at first.'); 14 debug('Check that page popup doesn\'t exist at first.');
15 shouldBeNull('internals.pagePopupWindow'); 15 shouldBeNull('internals.pagePopupWindow');
16 16
17 debug('Press F4 key.'); 17 debug('Press F4 key.');
18 sendKey(document.getElementById('test'), 'F4'); 18 sendKey(document.getElementById('test'), 'F4');
19 shouldBeNonNull('internals.pagePopupWindow'); 19 shouldBeNonNull('internals.pagePopupWindow');
20 20
21 function sendKey(input, keyName, ctrlKey, altKey) { 21 function sendKey(input, keyName, ctrlKey, altKey) {
22 var event = document.createEvent('KeyboardEvent'); 22 var event = document.createEvent('KeyboardEvent');
23 event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName , 0, ctrlKey, altKey); 23 event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName , 0, ctrlKey, altKey);
24 input.focus();
24 input.dispatchEvent(event); 25 input.dispatchEvent(event);
25 } 26 }
26 </script> 27 </script>
27 </body> 28 </body>
28 </html> 29 </html>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/forms/calendar-picker/date-picker-open-without-focus.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698