tor-browser

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

browser_bug882977.js (847B)


      1 "use strict";
      2 
      3 /**
      4 * Tests that the identity-box shows the chromeUI styling
      5 * when viewing such a page in a new window.
      6 */
      7 add_task(async function () {
      8  let homepage = "about:preferences";
      9  await SpecialPowers.pushPrefEnv({
     10    set: [
     11      ["browser.startup.homepage", homepage],
     12      ["browser.startup.page", 1],
     13    ],
     14  });
     15 
     16  let win = OpenBrowserWindow();
     17  await BrowserTestUtils.firstBrowserLoaded(win, false);
     18 
     19  let browser = win.gBrowser.selectedBrowser;
     20  is(browser.currentURI.spec, homepage, "Loaded the correct homepage");
     21  checkIdentityMode(win);
     22 
     23  await BrowserTestUtils.closeWindow(win);
     24 });
     25 
     26 function checkIdentityMode(win) {
     27  let identityMode = win.document.getElementById("identity-box").className;
     28  is(
     29    identityMode,
     30    "chromeUI",
     31    "Identity state should be chromeUI for about:home in a new window"
     32  );
     33 }