summaryrefslogtreecommitdiffstats
path: root/devtools/client/responsive.html/test/unit/test_change_network_throttling.js
blob: c20ae81338f07a24389864a95f51ee7b7ba1a1a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Test changing the network throttling state

const {
  changeNetworkThrottling,
} = require("devtools/client/responsive.html/actions/network-throttling");

add_task(function* () {
  let store = Store();
  const { getState, dispatch } = store;

  ok(!getState().networkThrottling.enabled,
    "Network throttling is disabled by default.");
  equal(getState().networkThrottling.profile, "",
    "Network throttling profile is empty by default.");

  dispatch(changeNetworkThrottling(true, "Bob"));

  ok(getState().networkThrottling.enabled,
    "Network throttling is enabled.");
  equal(getState().networkThrottling.profile, "Bob",
    "Network throttling profile is set.");
});