summaryrefslogtreecommitdiffstats
path: root/devtools/client/responsive/test/xpcshell/test_change_display_pixel_ratio.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/responsive/test/xpcshell/test_change_display_pixel_ratio.js')
-rw-r--r--devtools/client/responsive/test/xpcshell/test_change_display_pixel_ratio.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/devtools/client/responsive/test/xpcshell/test_change_display_pixel_ratio.js b/devtools/client/responsive/test/xpcshell/test_change_display_pixel_ratio.js
new file mode 100644
index 0000000000..7cc2604b7b
--- /dev/null
+++ b/devtools/client/responsive/test/xpcshell/test_change_display_pixel_ratio.js
@@ -0,0 +1,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}`
+ );
+});