| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../../../../fast/js/resources/js-test-pre.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 if (window.internals) | |
| 13 internals.setEnableMockPagePopup(true); | |
| 14 | |
| 15 description("Tests if pressing F4 opens the calendar picker."); | |
| 16 | |
| 17 debug('Check that page popup doesn\'t exist at first.'); | |
| 18 shouldBeNull('document.getElementById("mock-page-popup")'); | |
| 19 | |
| 20 debug('Press F4 key.'); | |
| 21 sendKey(document.getElementById('test'), 'F4'); | |
| 22 shouldBeNonNull('document.getElementById("mock-page-popup")'); | |
| 23 | |
| 24 function sendKey(input, keyName, ctrlKey, altKey) { | |
| 25 var event = document.createEvent('KeyboardEvent'); | |
| 26 event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName
, 0, ctrlKey, altKey); | |
| 27 input.dispatchEvent(event); | |
| 28 } | |
| 29 </script> | |
| 30 <script src="../../../../../fast/js/resources/js-test-post.js"></script> | |
| 31 </body> | |
| 32 </html> | |
| OLD | NEW |