fune/browser/base/content/test/general/browser_bug455852.js
Victor Porof f9f5914039 Bug 1561435 - Format browser/base/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36041

--HG--
extra : source : 96b3895a3b2aa2fcb064c85ec5857b7216884556
2019-07-05 09:48:57 +02:00

27 lines
766 B
JavaScript

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