1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/components/search/test/browser_405664.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,29 @@ 1.4 +function test() { 1.5 + var searchBar = BrowserSearch.searchBar; 1.6 + ok(searchBar, "got search bar"); 1.7 + 1.8 + searchBar.focus(); 1.9 + 1.10 + var pbo = searchBar._popup.popupBoxObject; 1.11 + ok(pbo, "popup is nsIPopupBoxObject"); 1.12 + 1.13 + EventUtils.synthesizeKey("VK_UP", { altKey: true }); 1.14 + is(pbo.popupState, "showing", "popup is opening after Alt+Up"); 1.15 + 1.16 + EventUtils.synthesizeKey("VK_ESCAPE", {}); 1.17 + is(pbo.popupState, "closed", "popup is closed after ESC"); 1.18 + 1.19 + EventUtils.synthesizeKey("VK_DOWN", { altKey: true }); 1.20 + is(pbo.popupState, "showing", "popup is opening after Alt+Down"); 1.21 + 1.22 + EventUtils.synthesizeKey("VK_ESCAPE", {}); 1.23 + is(pbo.popupState, "closed", "popup is closed after ESC 2"); 1.24 + 1.25 + if (!/Mac/.test(navigator.platform)) { 1.26 + EventUtils.synthesizeKey("VK_F4", {}); 1.27 + is(pbo.popupState, "showing", "popup is opening after F4"); 1.28 + 1.29 + EventUtils.synthesizeKey("VK_ESCAPE", {}); 1.30 + is(pbo.popupState, "closed", "popup is closed after ESC 3"); 1.31 + } 1.32 +}