summaryrefslogtreecommitdiffstats
path: root/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js')
-rw-r--r--devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js b/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js
new file mode 100644
index 0000000000..0f0d28da1d
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js
@@ -0,0 +1,54 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TARGET_PANES = [
+ {
+ title: "Temporary Extensions",
+ pref: "devtools.aboutdebugging.collapsibilities.temporaryExtension",
+ },
+ {
+ title: "Extensions",
+ pref: "devtools.aboutdebugging.collapsibilities.installedExtension",
+ },
+ {
+ title: "Tabs",
+ pref: "devtools.aboutdebugging.collapsibilities.tab",
+ },
+ {
+ title: "Service Workers",
+ pref: "devtools.aboutdebugging.collapsibilities.serviceWorker",
+ },
+ {
+ title: "Shared Workers",
+ pref: "devtools.aboutdebugging.collapsibilities.sharedWorker",
+ },
+ {
+ title: "Other Workers",
+ pref: "devtools.aboutdebugging.collapsibilities.otherWorker",
+ },
+];
+/* exported TARGET_PANES */
+
+function prepareCollapsibilitiesTest() {
+ // Make all collapsibilities to be expanded.
+ for (const { pref } of TARGET_PANES) {
+ Services.prefs.setBoolPref(pref, false);
+ }
+}
+/* exported prepareCollapsibilitiesTest */
+
+async function toggleCollapsibility(debugTargetPane) {
+ debugTargetPane.querySelector(".qa-debug-target-pane-title").click();
+ // Wait for animation of collapse/expand.
+ const animations = debugTargetPane.ownerDocument.getAnimations();
+ await Promise.all(animations.map(animation => animation.finished));
+}
+/* exported toggleCollapsibility */
+
+registerCleanupFunction(() => {
+ for (const { pref } of TARGET_PANES) {
+ Services.prefs.clearUserPref(pref);
+ }
+});