tor-browser

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

test_change_display_pixel_ratio.js (656B)


      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 display pixel ratio.
      7 
      8 const {
      9  changeDisplayPixelRatio,
     10 } = require("resource://devtools/client/responsive/actions/ui.js");
     11 
     12 const NEW_PIXEL_RATIO = 5.5;
     13 
     14 add_task(async function () {
     15  const store = Store();
     16  const { getState, dispatch } = store;
     17 
     18  equal(getState().ui.displayPixelRatio, 0, "Defaults to 0 at startup");
     19 
     20  dispatch(changeDisplayPixelRatio(NEW_PIXEL_RATIO));
     21  equal(
     22    getState().ui.displayPixelRatio,
     23    NEW_PIXEL_RATIO,
     24    `Display Pixel Ratio changed to ${NEW_PIXEL_RATIO}`
     25  );
     26 });