Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / calendar-picker / week-open-picker-with-f4-key.html
blob9326b07dbe22eb63a9172274f984be8d4d677192
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 <script src="resources/calendar-picker-common.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10 <input type=week id=test>
11 <script>
12 description("Tests if pressing F4 opens the calendar picker.");
14 debug('Check that page popup doesn\'t exist at first.');
15 shouldBeNull('internals.pagePopupWindow');
17 debug('Press F4 key.');
18 sendKey(document.getElementById('test'), 'F4');
19 shouldBeNonNull('internals.pagePopupWindow');
21 function sendKey(input, keyName, ctrlKey, altKey) {
22 var event = document.createEvent('KeyboardEvent');
23 event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName, 0, ctrlKey, altKey);
24 input.focus();
25 input.dispatchEvent(event);
27 </script>
28 </body>
29 </html>