tor-browser

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

test_change_network_throttling.js (848B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test changing the network throttling state
      7 
      8 const {
      9  changeNetworkThrottling,
     10 } = require("resource://devtools/client/shared/components/throttling/actions.js");
     11 
     12 add_task(async function () {
     13  const store = Store();
     14  const { getState, dispatch } = store;
     15 
     16  ok(
     17    !getState().networkThrottling.enabled,
     18    "Network throttling is disabled by default."
     19  );
     20  equal(
     21    getState().networkThrottling.profile,
     22    "",
     23    "Network throttling profile is empty by default."
     24  );
     25 
     26  dispatch(changeNetworkThrottling(true, "Bob"));
     27 
     28  ok(getState().networkThrottling.enabled, "Network throttling is enabled.");
     29  equal(
     30    getState().networkThrottling.profile,
     31    "Bob",
     32    "Network throttling profile is set."
     33  );
     34 });