michael@0: function test() { michael@0: var searchBar = BrowserSearch.searchBar; michael@0: ok(searchBar, "got search bar"); michael@0: michael@0: searchBar.focus(); michael@0: michael@0: var pbo = searchBar._popup.popupBoxObject; michael@0: ok(pbo, "popup is nsIPopupBoxObject"); michael@0: michael@0: EventUtils.synthesizeKey("VK_UP", { altKey: true }); michael@0: is(pbo.popupState, "showing", "popup is opening after Alt+Up"); michael@0: michael@0: EventUtils.synthesizeKey("VK_ESCAPE", {}); michael@0: is(pbo.popupState, "closed", "popup is closed after ESC"); michael@0: michael@0: EventUtils.synthesizeKey("VK_DOWN", { altKey: true }); michael@0: is(pbo.popupState, "showing", "popup is opening after Alt+Down"); michael@0: michael@0: EventUtils.synthesizeKey("VK_ESCAPE", {}); michael@0: is(pbo.popupState, "closed", "popup is closed after ESC 2"); michael@0: michael@0: if (!/Mac/.test(navigator.platform)) { michael@0: EventUtils.synthesizeKey("VK_F4", {}); michael@0: is(pbo.popupState, "showing", "popup is opening after F4"); michael@0: michael@0: EventUtils.synthesizeKey("VK_ESCAPE", {}); michael@0: is(pbo.popupState, "closed", "popup is closed after ESC 3"); michael@0: } michael@0: }