michael@0: function test() { michael@0: is(gBrowser.tabs.length, 1, "one tab is open"); michael@0: michael@0: gBrowser.selectedBrowser.focus(); michael@0: isnot(document.activeElement, gURLBar.inputField, "location bar is not focused"); michael@0: michael@0: var tab = gBrowser.selectedTab; michael@0: gPrefService.setBoolPref("browser.tabs.closeWindowWithLastTab", false); michael@0: EventUtils.synthesizeKey("w", { accelKey: true }); michael@0: is(tab.parentNode, null, "ctrl+w removes the tab"); michael@0: is(gBrowser.tabs.length, 1, "a new tab has been opened"); michael@0: is(document.activeElement, gURLBar.inputField, "location bar is focused for the new tab"); michael@0: michael@0: if (gPrefService.prefHasUserValue("browser.tabs.closeWindowWithLastTab")) michael@0: gPrefService.clearUserPref("browser.tabs.closeWindowWithLastTab"); michael@0: }