summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/test/browser_inspector_pane-toggle-04.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/inspector/test/browser_inspector_pane-toggle-04.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 '')
-rw-r--r--devtools/client/inspector/test/browser_inspector_pane-toggle-04.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/devtools/client/inspector/test/browser_inspector_pane-toggle-04.js b/devtools/client/inspector/test/browser_inspector_pane-toggle-04.js
new file mode 100644
index 0000000000..024fca816b
--- /dev/null
+++ b/devtools/client/inspector/test/browser_inspector_pane-toggle-04.js
@@ -0,0 +1,55 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Tests that the 3 pane inspector toggle button can render the bottom-left and
+// bottom-right panels of equal sizes in the SIDE host.
+
+add_task(async function () {
+ info("Switch to 2 pane inspector to test the 3 pane toggle button behavior");
+ await pushPref("devtools.inspector.three-pane-enabled", false);
+
+ const { inspector, toolbox } = await openInspectorForURL("about:blank");
+ const { panelDoc: doc } = inspector;
+
+ info("Switch the host to the right");
+ await toolbox.switchHost("right");
+
+ // Switching hosts is not correctly waiting when DevTools run in content frame
+ // See Bug 1571421.
+ await wait(1000);
+
+ const button = doc.querySelector(".sidebar-toggle");
+ const toolboxWidth = doc.getElementById("inspector-splitter-box").clientWidth;
+
+ info("Click on the toggle button to toggle ON 3 pane inspector");
+ let onRuleViewAdded = inspector.once("ruleview-added");
+ EventUtils.synthesizeMouseAtCenter(
+ button,
+ {},
+ inspector.panelDoc.defaultView
+ );
+ await onRuleViewAdded;
+
+ info("Checking the sizes of the 3 pane inspector");
+ const sidebarSplitBoxWidth = inspector.sidebarSplitBoxRef.current.state.width;
+ is(
+ sidebarSplitBoxWidth,
+ toolboxWidth / 2,
+ "Got correct sidebar split box width"
+ );
+
+ info("Click on the toggle button to toggle OFF the 3 pane inspector");
+ onRuleViewAdded = inspector.once("ruleview-added");
+ EventUtils.synthesizeMouseAtCenter(
+ button,
+ {},
+ inspector.panelDoc.defaultView
+ );
+ await onRuleViewAdded;
+
+ info("Checking the sidebar size of the 2 pane inspector");
+ const sidebarWidth = inspector.splitBox.state.width;
+ is(sidebarWidth, toolboxWidth, "Got correct sidebar width");
+});