Bug 1933114 - tests and fixes for tab group restoration r=dao,sessionstore-reviewers,tabbrowser-reviewers

Also addresses bug 1933574 by changing the schema of saved tab groups so that they look the same as closed tab groups (that is, the saved tab groups' tabs list now has the same schema as the _closedTabs list).

Differential Revision: https://phabricator.services.mozilla.com/D230322
This commit is contained in:
Stephen Thompson
2024-12-05 15:55:10 +00:00
parent 0d2cec9afd
commit e70b247934
14 changed files with 517 additions and 62 deletions

View File

@@ -1692,9 +1692,7 @@ add_task(async function test_saveAndCloseGroup() {
"#tabGroupEditor_saveAndCloseGroup"
);
let groupMatch = gBrowser.tabGroups.find(
possibleMatch => possibleMatch.id == group.id
);
let groupMatch = gBrowser.getTabGroupById(group.id);
Assert.ok(groupMatch, "Group exists in browser");
let events = [
@@ -1704,14 +1702,12 @@ add_task(async function test_saveAndCloseGroup() {
saveAndCloseGroupButton.click();
await Promise.all(events);
groupMatch = gBrowser.tabGroups.find(
possibleMatch => possibleMatch.id == group.id
);
groupMatch = gBrowser.getTabGroupById(group.id);
Assert.ok(!groupMatch, "Group was removed from browser");
let savedGroupMatch = SessionStore.savedGroups.find(
savedGroup => savedGroup.id == group.id
);
let savedGroupMatch = SessionStore.getSavedTabGroup(group.id);
Assert.ok(savedGroupMatch, "Group is in savedGroups");
SessionStore.forgetSavedTabGroup(group.id);
BrowserTestUtils.removeTab(tab);
});