tor-browser

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

browser_bookmarks_toolbar_shown_newtab.js (1013B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/
      3 */
      4 
      5 "use strict";
      6 
      7 // Entering customize mode should show the toolbar as long as it's not set to "never"
      8 add_task(async function () {
      9  await resetCustomization();
     10  ok(CustomizableUI.inDefaultState, "Default state to begin");
     11 
     12  let toolbar = document.querySelector("#PersonalToolbar");
     13  for (let state of ["always", "never", "newtab"]) {
     14    info(`Testing setting toolbar state to '${state}'`);
     15 
     16    setToolbarVisibility(toolbar, state, true, false);
     17 
     18    await startCustomizing();
     19 
     20    let expected = state != "never";
     21    await TestUtils.waitForCondition(
     22      () => !toolbar.collapsed == expected,
     23      `Waiting for toolbar visibility, state=${state}, visible=${!toolbar.collapsed}, expected=${expected}`
     24    );
     25    is(
     26      !toolbar.collapsed,
     27      expected,
     28      "The toolbar should be visible when state isn't 'never'"
     29    );
     30 
     31    await endCustomizing();
     32  }
     33  await resetCustomization();
     34 });