tor-browser

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

browser.js (760B)


      1 /**
      2 * Any copyright is dedicated to the Public Domain.
      3 * http://creativecommons.org/publicdomain/zero/1.0/
      4 */
      5 
      6 loadScript("dom/quota/test/common/system.js");
      7 
      8 function addTest(testFunction) {
      9  const taskFunction = async function () {
     10    await enableStorageTesting();
     11 
     12    await testFunction();
     13  };
     14 
     15  Object.defineProperty(taskFunction, "name", {
     16    value: testFunction.name,
     17    writable: false,
     18  });
     19 
     20  add_task(taskFunction);
     21 }
     22 
     23 async function enableStorageTesting() {
     24  const prefsToSet = [
     25    ["dom.quotaManager.testing", true],
     26    ["dom.simpleDB.enabled", true],
     27  ];
     28  if (Services.appinfo.OS === "WINNT") {
     29    prefsToSet.push(["dom.quotaManager.useDOSDevicePathSyntax", true]);
     30  }
     31 
     32  await SpecialPowers.pushPrefEnv({ set: prefsToSet });
     33 }