summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/compatibility/test/xpcshell
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/inspector/compatibility/test/xpcshell
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/inspector/compatibility/test/xpcshell')
-rw-r--r--devtools/client/inspector/compatibility/test/xpcshell/.eslintrc.js6
-rw-r--r--devtools/client/inspector/compatibility/test/xpcshell/head.js10
-rw-r--r--devtools/client/inspector/compatibility/test/xpcshell/test_default-browsers.js27
-rw-r--r--devtools/client/inspector/compatibility/test/xpcshell/xpcshell.ini7
4 files changed, 50 insertions, 0 deletions
diff --git a/devtools/client/inspector/compatibility/test/xpcshell/.eslintrc.js b/devtools/client/inspector/compatibility/test/xpcshell/.eslintrc.js
new file mode 100644
index 0000000000..86bd54c245
--- /dev/null
+++ b/devtools/client/inspector/compatibility/test/xpcshell/.eslintrc.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = {
+ // Extend from the common devtools xpcshell eslintrc config.
+ extends: "../../../../../.eslintrc.xpcshell.js",
+};
diff --git a/devtools/client/inspector/compatibility/test/xpcshell/head.js b/devtools/client/inspector/compatibility/test/xpcshell/head.js
new file mode 100644
index 0000000000..733c0400da
--- /dev/null
+++ b/devtools/client/inspector/compatibility/test/xpcshell/head.js
@@ -0,0 +1,10 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/* eslint no-unused-vars: [2, {"vars": "local"}] */
+
+const { require } = ChromeUtils.importESModule(
+ "resource://devtools/shared/loader/Loader.sys.mjs"
+);
diff --git a/devtools/client/inspector/compatibility/test/xpcshell/test_default-browsers.js b/devtools/client/inspector/compatibility/test/xpcshell/test_default-browsers.js
new file mode 100644
index 0000000000..c565e77d01
--- /dev/null
+++ b/devtools/client/inspector/compatibility/test/xpcshell/test_default-browsers.js
@@ -0,0 +1,27 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+// Test for the default browsers of user settings.
+
+const {
+ getBrowsersList,
+} = require("resource://devtools/shared/compatibility/compatibility-user-settings.js");
+
+add_task(async () => {
+ info("Check whether each default browsers data are unique by id and status");
+
+ const defaultBrowsers = await getBrowsersList();
+
+ for (const target of defaultBrowsers) {
+ const count = defaultBrowsers.reduce(
+ (currentCount, browser) =>
+ target.id === browser.id && target.status === browser.status
+ ? currentCount + 1
+ : currentCount,
+ 0
+ );
+
+ equal(count, 1, `This browser (${target.id} - ${target.status}) is unique`);
+ }
+});
diff --git a/devtools/client/inspector/compatibility/test/xpcshell/xpcshell.ini b/devtools/client/inspector/compatibility/test/xpcshell/xpcshell.ini
new file mode 100644
index 0000000000..7c0cf41e3c
--- /dev/null
+++ b/devtools/client/inspector/compatibility/test/xpcshell/xpcshell.ini
@@ -0,0 +1,7 @@
+[DEFAULT]
+tags = devtools
+head = head.js
+firefox-appdir = browser
+skip-if = toolkit == 'android'
+
+[test_default-browsers.js]