summaryrefslogtreecommitdiffstats
path: root/browser/tools/mozscreenshots/tests/xpcshell
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /browser/tools/mozscreenshots/tests/xpcshell
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/tools/mozscreenshots/tests/xpcshell')
-rw-r--r--browser/tools/mozscreenshots/tests/xpcshell/test_testConfigurations.js64
-rw-r--r--browser/tools/mozscreenshots/tests/xpcshell/xpcshell.ini5
2 files changed, 69 insertions, 0 deletions
diff --git a/browser/tools/mozscreenshots/tests/xpcshell/test_testConfigurations.js b/browser/tools/mozscreenshots/tests/xpcshell/test_testConfigurations.js
new file mode 100644
index 0000000000..8461e38939
--- /dev/null
+++ b/browser/tools/mozscreenshots/tests/xpcshell/test_testConfigurations.js
@@ -0,0 +1,64 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+"use strict";
+
+const { TestRunner } = ChromeUtils.importESModule(
+ "resource://test/TestRunner.sys.mjs"
+);
+
+add_task(async function capture() {
+ equal(TestRunner.findComma("Toolbars,Devs"), 8);
+ equal(TestRunner.findComma("Toolbars"), -1);
+ equal(TestRunner.findComma("Toolbars[onlyNavBar,allToolbars],DevTools"), 32);
+ equal(
+ TestRunner.findComma(
+ "Toolbars[onlyNavBar,allToolbars],DevTools[bottomToolbox,sideToolbox]"
+ ),
+ 32
+ );
+ equal(
+ TestRunner.findComma(
+ "Toolbars[[onlyNavBar],[]], Tabs[ [fiveTabbed], [[[fourPinned]]] ]"
+ ),
+ 25
+ );
+ equal(TestRunner.findComma("[[[[[[[[[[[[[[[[[[[[]]"), -1);
+ equal(TestRunner.findComma("Preferences[[[[[,]]]]]"), -1);
+
+ deepEqual(TestRunner.splitEnv("Toolbars"), ["Toolbars"]);
+ deepEqual(TestRunner.splitEnv("Buttons,Tabs"), ["Buttons", "Tabs"]);
+ deepEqual(TestRunner.splitEnv("Buttons, Tabs"), ["Buttons", "Tabs"]);
+ deepEqual(TestRunner.splitEnv(" Buttons , Tabs "), [
+ "Buttons",
+ "Tabs",
+ ]);
+ deepEqual(TestRunner.splitEnv("Toolbars[onlyNavBar,allToolbars],DevTools"), [
+ "Toolbars[onlyNavBar,allToolbars]",
+ "DevTools",
+ ]);
+ deepEqual(
+ TestRunner.splitEnv(
+ "Toolbars[onlyNavBar,allToolbars],DevTools[bottomToolbox]"
+ ),
+ ["Toolbars[onlyNavBar,allToolbars]", "DevTools[bottomToolbox]"]
+ );
+ deepEqual(
+ TestRunner.splitEnv(
+ "Toolbars[onlyNavBar,allToolbars],DevTools[bottomToolbox],Tabs"
+ ),
+ ["Toolbars[onlyNavBar,allToolbars]", "DevTools[bottomToolbox]", "Tabs"]
+ );
+
+ let filteredData = TestRunner.filterRestrictions("Toolbars[onlyNavBar]");
+ equal(filteredData.trimmedSetName, "Toolbars");
+ ok(filteredData.restrictions.has("onlyNavBar"));
+
+ filteredData = TestRunner.filterRestrictions(
+ "DevTools[bottomToolbox,sideToolbox]"
+ );
+ equal(filteredData.trimmedSetName, "DevTools");
+ ok(filteredData.restrictions.has("bottomToolbox"));
+ ok(filteredData.restrictions.has("sideToolbox"));
+});
diff --git a/browser/tools/mozscreenshots/tests/xpcshell/xpcshell.ini b/browser/tools/mozscreenshots/tests/xpcshell/xpcshell.ini
new file mode 100644
index 0000000000..c318ae4971
--- /dev/null
+++ b/browser/tools/mozscreenshots/tests/xpcshell/xpcshell.ini
@@ -0,0 +1,5 @@
+[DEFAULT]
+skip-if = toolkit == 'android' # bug 1730213
+support-files = ../../mozscreenshots/extension/TestRunner.sys.mjs
+
+[test_testConfigurations.js]