1
0
Fork 0
firefox/browser/base/content/test/general/browser_bug455852.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

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