From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../compatibility/test/xpcshell/.eslintrc.js | 6 +++++ .../inspector/compatibility/test/xpcshell/head.js | 10 ++++++++ .../test/xpcshell/test_default-browsers.js | 27 ++++++++++++++++++++++ .../compatibility/test/xpcshell/xpcshell.toml | 7 ++++++ 4 files changed, 50 insertions(+) create mode 100644 devtools/client/inspector/compatibility/test/xpcshell/.eslintrc.js create mode 100644 devtools/client/inspector/compatibility/test/xpcshell/head.js create mode 100644 devtools/client/inspector/compatibility/test/xpcshell/test_default-browsers.js create mode 100644 devtools/client/inspector/compatibility/test/xpcshell/xpcshell.toml (limited to 'devtools/client/inspector/compatibility/test/xpcshell') 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"] -- cgit v1.2.3