1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/base/content/test/general/browser_bug455852.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +function test() { 1.5 + is(gBrowser.tabs.length, 1, "one tab is open"); 1.6 + 1.7 + gBrowser.selectedBrowser.focus(); 1.8 + isnot(document.activeElement, gURLBar.inputField, "location bar is not focused"); 1.9 + 1.10 + var tab = gBrowser.selectedTab; 1.11 + gPrefService.setBoolPref("browser.tabs.closeWindowWithLastTab", false); 1.12 + EventUtils.synthesizeKey("w", { accelKey: true }); 1.13 + is(tab.parentNode, null, "ctrl+w removes the tab"); 1.14 + is(gBrowser.tabs.length, 1, "a new tab has been opened"); 1.15 + is(document.activeElement, gURLBar.inputField, "location bar is focused for the new tab"); 1.16 + 1.17 + if (gPrefService.prefHasUserValue("browser.tabs.closeWindowWithLastTab")) 1.18 + gPrefService.clearUserPref("browser.tabs.closeWindowWithLastTab"); 1.19 +}