diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /devtools/client/inspector/test/browser_inspector_pane-toggle-03.js | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | devtools/client/inspector/test/browser_inspector_pane-toggle-03.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/devtools/client/inspector/test/browser_inspector_pane-toggle-03.js b/devtools/client/inspector/test/browser_inspector_pane-toggle-03.js new file mode 100644 index 0000000000..1522781832 --- /dev/null +++ b/devtools/client/inspector/test/browser_inspector_pane-toggle-03.js @@ -0,0 +1,60 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Tests that the 3 pane inspector toggle can render the middle and right panels of equal +// sizes when the original sidebar can be doubled in width and be smaller than half the +// toolbox's width in the BOTTOM host. + +const SIDEBAR_WIDTH = 200; + +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 } = await openInspectorForURL("about:blank"); + const { panelDoc: doc } = inspector; + const button = doc.querySelector(".sidebar-toggle"); + const toolboxWidth = doc.getElementById("inspector-splitter-box").clientWidth; + + if (toolboxWidth < 600) { + ok(true, "Can't run the full test because the toolbox width is too small."); + } else { + info("Set the sidebar width to 200px"); + inspector.splitBox.setState({ width: SIDEBAR_WIDTH }); + + 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"); + let sidebarWidth = inspector.splitBox.state.width; + const sidebarSplitBoxWidth = + inspector.sidebarSplitBoxRef.current.state.width; + is(sidebarWidth, SIDEBAR_WIDTH * 2, "Got correct main split box width"); + is( + sidebarSplitBoxWidth, + SIDEBAR_WIDTH, + "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"); + sidebarWidth = inspector.splitBox.state.width; + is(sidebarWidth, SIDEBAR_WIDTH, "Got correct sidebar width"); + } +}); |