tor-browser

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

browser_toolbox_options_disable_cache-01.js (1170B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 requestLongerTimeout(2);
      7 
      8 // Tests that disabling the cache for a tab works as it should when toolboxes
      9 // are not toggled.
     10 /* import-globals-from helper_disable_cache.js */
     11 loadHelperScript("helper_disable_cache.js");
     12 
     13 add_task(async function () {
     14  // Disable rcwn to make cache behavior deterministic.
     15  await pushPref("network.http.rcwn.enabled", false);
     16 
     17  // Ensure that the setting is cleared after the test.
     18  registerCleanupFunction(() => {
     19    info("Resetting devtools.cache.disabled to false.");
     20    Services.prefs.setBoolPref("devtools.cache.disabled", false);
     21  });
     22 
     23  // Initialise tabs: 1 and 2 with a toolbox, 3 and 4 without.
     24  for (const tab of tabs) {
     25    await initTab(tab, tab.startToolbox);
     26  }
     27 
     28  // Ensure cache is enabled for all tabs.
     29  await checkCacheStateForAllTabs([true, true, true, true]);
     30 
     31  // Check the checkbox in tab 0 and ensure cache is disabled for tabs 0 and 1.
     32  await setDisableCacheCheckboxChecked(tabs[0], true);
     33  await checkCacheStateForAllTabs([false, false, true, true]);
     34 
     35  await finishUp();
     36 });