diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /devtools/client/inspector/compatibility/test/xpcshell | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/inspector/compatibility/test/xpcshell')
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] |