diff options
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] |