Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <select id="menu"> | |
| 5 <option>foo</option> | |
| 6 <option>bar</option> | |
| 7 </select> | |
| 8 <form action="data:text/html,<script>console.log('Check that first disconn ecting then closing a page popup does not crash.'); console.log('PASS: no crash' );testRunner.notifyDone();</script>" id="form1"> | |
| 9 </form> | |
| 10 <script> | |
| 11 if (window.testRunner) { | |
| 12 testRunner.waitUntilDone(); | |
| 13 testRunner.dumpAsText(); | |
| 14 } | |
| 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 } | |
| 20 function openPicker(menu) { | |
|
keishi
2015/02/11 11:44:08
We have this function in fast/forms/resources/pick
| |
| 21 window.moveTo(); | |
| 22 menu.offsetTop; | |
| 23 sendKey(menu, "Down", false, true); | |
| 24 } | |
| 25 | |
| 26 function runTest() { | |
| 27 openPicker(document.getElementById('menu')); | |
| 28 setTimeout(function() {document.getElementById('form1').submit();}, 0); | |
| 29 } | |
| 30 window.onload = runTest; | |
| 31 </script> | |
| 32 </body> | |
| 33 </html> | |
| OLD | NEW |