tor-browser

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

browser_layersacceleration.js (1157B)


      1 add_task(async function () {
      2  // We must temporarily disable `Once` StaticPrefs check for the duration of
      3  // this test (see bug 1556131). We must do so in a separate operation as
      4  // pushPrefEnv doesn't set the preferences in the order one could expect.
      5  await SpecialPowers.pushPrefEnv({
      6    set: [["preferences.force-disable.check.once.policy", true]],
      7  });
      8  await SpecialPowers.pushPrefEnv({
      9    set: [["layers.acceleration.disabled", false]],
     10  });
     11 
     12  let prefs = await openPreferencesViaOpenPreferencesAPI("paneGeneral", {
     13    leaveOpen: true,
     14  });
     15  is(prefs.selectedPane, "paneGeneral", "General pane was selected");
     16 
     17  let doc = gBrowser.contentDocument;
     18  let checkbox = doc.querySelector("#allowHWAccel");
     19  is(
     20    !checkbox.checked,
     21    Services.prefs.getBoolPref("layers.acceleration.disabled"),
     22    "checkbox should represent inverted pref value before clicking on checkbox"
     23  );
     24 
     25  checkbox.click();
     26 
     27  is(
     28    !checkbox.checked,
     29    Services.prefs.getBoolPref("layers.acceleration.disabled"),
     30    "checkbox should represent inverted pref value after clicking on checkbox"
     31  );
     32  BrowserTestUtils.removeTab(gBrowser.selectedTab);
     33 });