4 <script src=
"../../../resources/js-test.js"></script>
5 <script src=
"resources/calendar-picker-common.js"></script>
8 <p id=
"description"></p>
9 <div id=
"console"></div>
10 <input type=week id=test
>
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
);
25 input
.dispatchEvent(event
);