summaryrefslogtreecommitdiffstats
path: root/devtools/client/framework/test/browser_toolbox_theme.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/framework/test/browser_toolbox_theme.js
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/framework/test/browser_toolbox_theme.js')
-rw-r--r--devtools/client/framework/test/browser_toolbox_theme.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/devtools/client/framework/test/browser_toolbox_theme.js b/devtools/client/framework/test/browser_toolbox_theme.js
new file mode 100644
index 0000000000..63d83e8312
--- /dev/null
+++ b/devtools/client/framework/test/browser_toolbox_theme.js
@@ -0,0 +1,33 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+const PREF_DEVTOOLS_THEME = "devtools.theme";
+
+registerCleanupFunction(() => {
+ // Set preferences back to their original values
+ Services.prefs.clearUserPref(PREF_DEVTOOLS_THEME);
+});
+
+add_task(async function testDevtoolsTheme() {
+ info("Checking stylesheet and :root attributes based on devtools theme.");
+ Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "light");
+ is(
+ document.getElementById("appcontent").getAttribute("devtoolstheme"),
+ "light",
+ "The element has an attribute based on devtools theme."
+ );
+
+ Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "dark");
+ is(
+ document.getElementById("appcontent").getAttribute("devtoolstheme"),
+ "dark",
+ "The element has an attribute based on devtools theme."
+ );
+
+ Services.prefs.setCharPref(PREF_DEVTOOLS_THEME, "unknown");
+ is(
+ document.getElementById("appcontent").getAttribute("devtoolstheme"),
+ "light",
+ "The element has 'light' as a default for the devtoolstheme attribute."
+ );
+});