tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_tab_groups_empty.js (885B)


      1 "use strict";
      2 
      3 const ORIG_STATE = SessionStore.getBrowserState();
      4 
      5 registerCleanupFunction(async () => {
      6  await SessionStoreTestUtils.promiseBrowserState(ORIG_STATE);
      7 });
      8 
      9 add_task(async function test_ZeroTabGroups() {
     10  let win = await promiseNewWindowLoaded();
     11  const state = ss.getWindowState(win);
     12 
     13  Assert.equal(state.windows.length, 1, "should have state from 1 window");
     14  const windowState = state.windows[0];
     15 
     16  Assert.ok(windowState.groups, "window state should have a `groups` property");
     17  Assert.equal(
     18    windowState.groups.length,
     19    0,
     20    "`groups` property should be 0 since there are no tab groups"
     21  );
     22 
     23  const countOfGroupedTabs = windowState.tabs.filter(tab => tab.groupId).length;
     24  Assert.equal(
     25    countOfGroupedTabs,
     26    0,
     27    "none of the tabs should refer to a tab group"
     28  );
     29  await BrowserTestUtils.closeWindow(win);
     30  forgetClosedWindows();
     31 });