gavin%gavinsharp.com 4e8ee7ac44 Bug 405664: keyboard shortcuts to display the search engine list broken, r=enndeakin, a=schrep
git-svn-id: svn://10.0.0.236/trunk@240362 18797224-902f-48f8-a5cc-f745e15eee43
2007-12-03 22:35:08 +00:00

30 lines
939 B
JavaScript

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");
}
}