Index: LayoutTests/fast/forms/select/menulist-popup-open-hide-using-keyboard.html |
diff --git a/LayoutTests/fast/forms/select/menulist-popup-open-hide-using-keyboard.html b/LayoutTests/fast/forms/select/menulist-popup-open-hide-using-keyboard.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9f2ebd16e6e1fdc367b383a97a0c07fcc9b004e7 |
--- /dev/null |
+++ b/LayoutTests/fast/forms/select/menulist-popup-open-hide-using-keyboard.html |
@@ -0,0 +1,66 @@ |
+<html> |
+<head> |
+<script src="../../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<select id="select"> |
+<option value="one">One</option> |
+<option value="two">Two</option> |
+</select> |
+<script> |
+function test() |
+{ |
+ description('Test for opening select popup and closing.'); |
+ |
+ popup = document.getElementById('select'); |
+ |
+ debug('These tests run specfically for Linux and Windows'); |
+ |
+ debug('Test opening and closing of popup using alt and down arrow key'); |
+ popup.focus(); |
+ eventSender.keyDown('downArrow', ['altKey']); |
+ shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
+ eventSender.keyDown('downArrow', ['altKey']); |
+ shouldBeFalse('internals.isSelectPopupVisible(popup)'); |
+ |
+ debug('Test opening and closing of popup using alt and up arrow key'); |
+ popup.focus(); |
+ eventSender.keyDown('upArrow', ['altKey']); |
+ shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
+ eventSender.keyDown('upArrow', ['altKey']); |
+ shouldBeFalse('internals.isSelectPopupVisible(popup)'); |
+ popup.blur(); |
+ |
+ debug('Test opening of popup using F4'); |
+ popup.focus(); |
+ eventSender.keyDown('F4'); |
+ shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
+ popup.blur(); |
+ |
+ debug('Test opening of popup using enter key'); |
+ popup.focus(); |
+ eventSender.keyDown('\r', []); |
+ shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
+ popup.blur(); |
+ |
+ debug('Works for all platforms'); |
+ |
+ debug('Test opening of popup using space key'); |
+ popup.focus(); |
+ eventSender.keyDown(' '); |
+ shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
+ popup.blur(); |
+ |
+ debug('Works for only mac'); |
+ |
+ debug('Test opening of popup using up key'); |
+ popup.focus(); |
+ eventSender.keyDown('upArrow'); |
+ shouldBeTrue('internals.isSelectPopupVisible(popup)'); |
+ popup.blur(); |
+ |
+} |
+test(); |
+</script> |
+</body> |
+</html> |