| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
| 4 </head> | 4 </head> |
| 5 <body> | 5 <body> |
| 6 <select id="select"> | 6 <select id="select"> |
| 7 <option value="one">One</option> | 7 <option value="one">One</option> |
| 8 <option value="two">Two</option> | 8 <option value="two">Two</option> |
| 9 </select> | 9 </select> |
| 10 <script> | 10 <script> |
| 11 window.jsTestIsAsync = true; | 11 window.jsTestIsAsync = true; |
| 12 | 12 |
| 13 function test() | 13 function test() |
| 14 { | 14 { |
| 15 description('Test for opening select popup and closing.'); | 15 description('Test for opening select popup and closing.'); |
| 16 | 16 |
| 17 popup = document.getElementById('select'); | 17 popup = document.getElementById('select'); |
| 18 | 18 |
| 19 debug('These tests run specfically for Linux and Windows'); | 19 debug('These tests run specfically for Linux and Windows'); |
| 20 | 20 |
| 21 debug('Test opening and closing of popup using alt and down arrow key'); | 21 debug('Test opening and closing of popup using alt and down arrow key'); |
| 22 popup.focus(); | 22 popup.focus(); |
| 23 eventSender.keyDown('downArrow', ['altKey']); | 23 eventSender.keyDown('ArrowDown', ['altKey']); |
| 24 shouldBeTrue('internals.isSelectPopupVisible(popup)'); | 24 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 25 eventSender.keyDown('downArrow', ['altKey']); | 25 eventSender.keyDown('ArrowDown', ['altKey']); |
| 26 // We need this delay because in ListPicker._handleKeyDown we hide the | 26 // We need this delay because in ListPicker._handleKeyDown we hide the |
| 27 // popup with a delay to avoid reopening the popup. | 27 // popup with a delay to avoid reopening the popup. |
| 28 setTimeout(test2, 0); | 28 setTimeout(test2, 0); |
| 29 } | 29 } |
| 30 function test2() { | 30 function test2() { |
| 31 shouldBeFalse('internals.isSelectPopupVisible(popup)'); | 31 shouldBeFalse('internals.isSelectPopupVisible(popup)'); |
| 32 | 32 |
| 33 debug('Test opening and closing of popup using alt and up arrow key'); | 33 debug('Test opening and closing of popup using alt and up arrow key'); |
| 34 popup.focus(); | 34 popup.focus(); |
| 35 eventSender.keyDown('upArrow', ['altKey']); | 35 eventSender.keyDown('ArrowUp', ['altKey']); |
| 36 shouldBeTrue('internals.isSelectPopupVisible(popup)'); | 36 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 37 eventSender.keyDown('upArrow', ['altKey']); | 37 eventSender.keyDown('ArrowUp', ['altKey']); |
| 38 // We need this delay because in ListPicker._handleKeyDown we hide the | 38 // We need this delay because in ListPicker._handleKeyDown we hide the |
| 39 // popup with a delay to avoid reopening the popup. | 39 // popup with a delay to avoid reopening the popup. |
| 40 setTimeout(test3, 0); | 40 setTimeout(test3, 0); |
| 41 } | 41 } |
| 42 function test3() { | 42 function test3() { |
| 43 shouldBeFalse('internals.isSelectPopupVisible(popup)'); | 43 shouldBeFalse('internals.isSelectPopupVisible(popup)'); |
| 44 popup.blur(); | 44 popup.blur(); |
| 45 | 45 |
| 46 debug('Test opening of popup using F4'); | 46 debug('Test opening of popup using F4'); |
| 47 popup.focus(); | 47 popup.focus(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 60 debug('Test opening of popup using space key'); | 60 debug('Test opening of popup using space key'); |
| 61 popup.focus(); | 61 popup.focus(); |
| 62 eventSender.keyDown(' '); | 62 eventSender.keyDown(' '); |
| 63 shouldBeTrue('internals.isSelectPopupVisible(popup)'); | 63 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 64 popup.blur(); | 64 popup.blur(); |
| 65 | 65 |
| 66 debug('Works for only mac'); | 66 debug('Works for only mac'); |
| 67 | 67 |
| 68 debug('Test opening of popup using up key'); | 68 debug('Test opening of popup using up key'); |
| 69 popup.focus(); | 69 popup.focus(); |
| 70 eventSender.keyDown('upArrow'); | 70 eventSender.keyDown('ArrowUp'); |
| 71 shouldBeTrue('internals.isSelectPopupVisible(popup)'); | 71 shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
| 72 popup.blur(); | 72 popup.blur(); |
| 73 | 73 |
| 74 finishJSTest(); | 74 finishJSTest(); |
| 75 } | 75 } |
| 76 test(); | 76 test(); |
| 77 </script> | 77 </script> |
| 78 </body> | 78 </body> |
| 79 </html> | 79 </html> |
| OLD | NEW |