summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/compatibility/test/xpcshell
diff options
context:
space:
mode:
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.toml7
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.toml b/devtools/client/inspector/compatibility/test/xpcshell/xpcshell.toml
new file mode 100644
index 0000000000..f5f7e97e39
--- /dev/null
+++ b/devtools/client/inspector/compatibility/test/xpcshell/xpcshell.toml
@@ -0,0 +1,7 @@
+[DEFAULT]
+tags = "devtools"
+head = "head.js"
+firefox-appdir = "browser"
+skip-if = ["os == 'android'"]
+
+["test_default-browsers.js"]