OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../../resources/js-test.js"></script> |
| 4 </head> |
| 5 <body> |
| 6 <select id="select"> |
| 7 <option value="one">One</option> |
| 8 <option value="two">Two</option> |
| 9 </select> |
| 10 <script> |
| 11 function test() |
| 12 { |
| 13 description('Test for opening select popup and closing.'); |
| 14 |
| 15 popup = document.getElementById('select'); |
| 16 |
| 17 debug('These tests run specfically for Linux and Windows'); |
| 18 |
| 19 debug('Test opening and closing of popup using alt and down arrow key'); |
| 20 popup.focus(); |
| 21 eventSender.keyDown('downArrow', ['altKey']); |
| 22 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 23 eventSender.keyDown('downArrow', ['altKey']); |
| 24 shouldBeFalse('internals.isSelectPopupVisible(popup)'); |
| 25 |
| 26 debug('Test opening and closing of popup using alt and up arrow key'); |
| 27 popup.focus(); |
| 28 eventSender.keyDown('upArrow', ['altKey']); |
| 29 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 30 eventSender.keyDown('upArrow', ['altKey']); |
| 31 shouldBeFalse('internals.isSelectPopupVisible(popup)'); |
| 32 popup.blur(); |
| 33 |
| 34 debug('Test opening of popup using F4'); |
| 35 popup.focus(); |
| 36 eventSender.keyDown('F4'); |
| 37 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 38 popup.blur(); |
| 39 |
| 40 debug('Test opening of popup using enter key'); |
| 41 popup.focus(); |
| 42 eventSender.keyDown('\r', []); |
| 43 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 44 popup.blur(); |
| 45 |
| 46 debug('Works for all platforms'); |
| 47 |
| 48 debug('Test opening of popup using space key'); |
| 49 popup.focus(); |
| 50 eventSender.keyDown(' '); |
| 51 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 52 popup.blur(); |
| 53 |
| 54 debug('Works for only mac'); |
| 55 |
| 56 debug('Test opening of popup using up key'); |
| 57 popup.focus(); |
| 58 eventSender.keyDown('upArrow'); |
| 59 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 60 popup.blur(); |
| 61 |
| 62 } |
| 63 test(); |
| 64 </script> |
| 65 </body> |
| 66 </html> |
OLD | NEW |