This patch makes saved tab groups use the "closed tabs" schema for storing tab data. This makes saved tab groups consistent with closed tabs and closed tab groups. The tab/tab group restoration code is built to work with the "closed tabs" schema, so this schema change allows saved tab groups to be restored correctly. Bug 1933114 will add and improve the tests for restoring tab groups. Differential Revision: https://phabricator.services.mozilla.com/D231818
32 lines
885 B
JavaScript
32 lines
885 B
JavaScript
"use strict";
|
|
|
|
const ORIG_STATE = SessionStore.getBrowserState();
|
|
|
|
registerCleanupFunction(async () => {
|
|
await SessionStoreTestUtils.promiseBrowserState(ORIG_STATE);
|
|
});
|
|
|
|
add_task(async function test_ZeroTabGroups() {
|
|
let win = await promiseNewWindowLoaded();
|
|
const state = ss.getWindowState(win);
|
|
|
|
Assert.equal(state.windows.length, 1, "should have state from 1 window");
|
|
const windowState = state.windows[0];
|
|
|
|
Assert.ok(windowState.groups, "window state should have a `groups` property");
|
|
Assert.equal(
|
|
windowState.groups.length,
|
|
0,
|
|
"`groups` property should be 0 since there are no tab groups"
|
|
);
|
|
|
|
const countOfGroupedTabs = windowState.tabs.filter(tab => tab.groupId).length;
|
|
Assert.equal(
|
|
countOfGroupedTabs,
|
|
0,
|
|
"none of the tabs should refer to a tab group"
|
|
);
|
|
await BrowserTestUtils.closeWindow(win);
|
|
forgetClosedWindows();
|
|
});
|