Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script> | 4 <script> |
| 5 window.jsTestIsAsync = true; | |
| 5 window.enablePixelTesting = true; | 6 window.enablePixelTesting = true; |
| 6 </script> | 7 </script> |
| 7 <script src="../../../resources/js-test.js"></script> | 8 <script src="../../../resources/js-test.js"></script> |
| 8 <script src="../../forms/resources/picker-common.js"></script> | |
|
tkent
2014/09/29 06:20:45
We should have additional utility JS functions to
keishi
2014/09/29 12:48:44
Done.
| |
| 9 <script src="resources/calendar-picker-common.js"></script> | |
| 10 </head> | 9 </head> |
| 11 <body> | 10 <body> |
| 12 <input type=date id=date value="10000-12-31"> | 11 <input type=date id=date value="10000-12-31"> |
| 13 | |
| 14 <p id="description" style="opacity: 0"></p> | 12 <p id="description" style="opacity: 0"></p> |
| 15 <div id="console" style="opacity: 0"></div> | 13 <div id="console" style="opacity: 0"></div> |
| 14 <script> | |
| 15 function sendKey(input, keyName, ctrlKey, altKey) { | |
| 16 var event = document.createEvent('KeyboardEvent'); | |
| 17 event.initKeyboardEvent('keydown', true, true, document.defaultView, keyName , 0, ctrlKey, altKey); | |
| 18 input.dispatchEvent(event); | |
| 19 } | |
| 16 | 20 |
| 17 <script> | 21 function openPicker(input, callback) { |
| 18 openPicker(document.getElementById('date'), finishJSTest); | 22 input.offsetTop; // Force layout. |
| 23 sendKey(input, "Down", false, true); | |
| 24 window.internals.pagePopupWindow.addEventListener("didOpenPicker", callback, false); | |
| 25 } | |
| 26 | |
| 27 // Move window to the top left of available space. | |
| 28 window.moveTo(); | |
| 29 openPicker(document.getElementById('date'), function () { | |
| 30 // We need to keep moving the window to the top left of available space | |
| 31 // because the window will move back to (0, 0) when the | |
| 32 // ShellViewMsg_SetTestConfiguration IPC arrives. | |
| 33 window.moveTo(); | |
| 34 finishJSTest(); | |
| 35 }); | |
| 36 | |
| 19 </script> | 37 </script> |
| 20 </body> | 38 </body> |
| 21 </html> | 39 </html> |
| OLD | NEW |