tor-browser

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

browser_screenshot_button_disabled.js (784B)


      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 add_task(async function testScreenshotButtonPrefDisabled() {
      8  info("Test the Screenshots widget not available");
      9 
     10  Services.prefs.setBoolPref("screenshots.browser.component.enabled", false);
     11 
     12  Assert.ok(
     13    !Services.prefs.getBoolPref("screenshots.browser.component.enabled", true),
     14    "Sceenshots feature is disabled"
     15  );
     16 
     17  CustomizableUI.addWidgetToArea(
     18    "screenshot-button",
     19    CustomizableUI.AREA_NAVBAR
     20  );
     21 
     22  let screenshotBtn = document.getElementById("screenshot-button");
     23  Assert.ok(!screenshotBtn, "Screenshot button is unavailable");
     24 });