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