forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1732366 - When closing last tab while having private window, remo…
…ve the tab from the tabs list . r=Gijs With session restore and close window on last tab close both enabled, if the last tab is closed while having another private window, move it from the winData.tabs list to the winData._closedTabs list. Differential Revision: https://phabricator.services.mozilla.com/D126590
- Loading branch information
1 parent
9b7ffaf
commit d3cdb6e
Showing
5 changed files
with
61 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
browser/components/sessionstore/test/browser_close_last_nonprivate_tab.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
http://creativecommons.org/publicdomain/zero/1.0/ */ | ||
|
||
"use strict"; | ||
|
||
/** | ||
* With session restore enabled and quit on last tab close enabled | ||
* When closing the last tab while having another private window, | ||
* it shouldn't be restored at the next startup of Firefox. | ||
* See bug 1732366 for more information. | ||
*/ | ||
add_task(async function test_bug_1730021() { | ||
await SpecialPowers.pushPrefEnv({ | ||
set: [["browser.sessionstore.resume_session_once", true]], | ||
}); | ||
ok(SessionStore.willAutoRestore, "the session will be restored if we quit"); | ||
|
||
SessionStore.maybeDontSaveTabs(window); | ||
ok(window._dontSaveTabs, "the tabs should be closed at quit"); | ||
delete window._dontSaveTabs; | ||
ok(!window._dontSaveTabs, "the flag should be reset"); | ||
|
||
let newWin = await BrowserTestUtils.openNewBrowserWindow({ private: true }); | ||
|
||
SessionStore.maybeDontSaveTabs(window); | ||
ok( | ||
window._dontSaveTabs, | ||
"the tabs should be closed at quit even if a private window is open" | ||
); | ||
delete window._dontSaveTabs; | ||
ok(!window._dontSaveTabs, "the flag should be reset"); | ||
|
||
await BrowserTestUtils.closeWindow(newWin); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters