diff -r 000000000000 -r 6474c204b198 browser/components/search/test/browser_405664.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/components/search/test/browser_405664.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,29 @@ +function test() { + var searchBar = BrowserSearch.searchBar; + ok(searchBar, "got search bar"); + + searchBar.focus(); + + var pbo = searchBar._popup.popupBoxObject; + ok(pbo, "popup is nsIPopupBoxObject"); + + EventUtils.synthesizeKey("VK_UP", { altKey: true }); + is(pbo.popupState, "showing", "popup is opening after Alt+Up"); + + EventUtils.synthesizeKey("VK_ESCAPE", {}); + is(pbo.popupState, "closed", "popup is closed after ESC"); + + EventUtils.synthesizeKey("VK_DOWN", { altKey: true }); + is(pbo.popupState, "showing", "popup is opening after Alt+Down"); + + EventUtils.synthesizeKey("VK_ESCAPE", {}); + is(pbo.popupState, "closed", "popup is closed after ESC 2"); + + if (!/Mac/.test(navigator.platform)) { + EventUtils.synthesizeKey("VK_F4", {}); + is(pbo.popupState, "showing", "popup is opening after F4"); + + EventUtils.synthesizeKey("VK_ESCAPE", {}); + is(pbo.popupState, "closed", "popup is closed after ESC 3"); + } +}