summaryrefslogtreecommitdiffstats
path: root/devtools/client/responsive/test/xpcshell/test_change_display_pixel_ratio.js
blob: 7cc2604b7ba3b4858fdfe49ea1c0a9830f5bb39c (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
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

// Test changing the display pixel ratio.

const {
  changeDisplayPixelRatio,
} = require("resource://devtools/client/responsive/actions/ui.js");

const NEW_PIXEL_RATIO = 5.5;

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

  equal(getState().ui.displayPixelRatio, 0, "Defaults to 0 at startup");

  dispatch(changeDisplayPixelRatio(NEW_PIXEL_RATIO));
  equal(
    getState().ui.displayPixelRatio,
    NEW_PIXEL_RATIO,
    `Display Pixel Ratio changed to ${NEW_PIXEL_RATIO}`
  );
});