tor-browser

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

browser_940946_removable_from_navbar_customizemode.js (924B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 const kTestBtnId = "test-removable-navbar-customize-mode";
      8 
      9 // Items without the removable attribute in the navbar should be considered non-removable
     10 add_task(async function () {
     11  let btn = createDummyXULButton(
     12    kTestBtnId,
     13    "Test removable in navbar in customize mode"
     14  );
     15  CustomizableUI.getCustomizationTarget(
     16    document.getElementById("nav-bar")
     17  ).appendChild(btn);
     18  await startCustomizing();
     19  ok(
     20    !CustomizableUI.isWidgetRemovable(kTestBtnId),
     21    "Widget should not be considered removable"
     22  );
     23  await endCustomizing();
     24  document.getElementById(kTestBtnId).remove();
     25 });
     26 
     27 add_task(async function asyncCleanup() {
     28  await endCustomizing();
     29  await resetCustomization();
     30 });