browser_inspector_pane-toggle-01.js (1201B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Tests that the inspector panel has a 3 pane toggle button, and that 7 // this button is visible both in BOTTOM and SIDE hosts. 8 9 add_task(async function () { 10 info("Switch to 2 pane inspector to test the 3 pane toggle button behavior"); 11 await pushPref("devtools.inspector.three-pane-enabled", false); 12 13 info("Open the inspector in a bottom toolbox host"); 14 const { inspector, toolbox } = await openInspectorForURL( 15 "about:blank", 16 "bottom" 17 ); 18 19 const button = inspector.panelDoc.querySelector(".sidebar-toggle"); 20 ok(button, "The toggle button exists in the DOM"); 21 ok(button.getAttribute("title"), "The title tooltip has initial state"); 22 ok( 23 button.classList.contains("pane-collapsed"), 24 "The button is in collapsed state" 25 ); 26 ok(!!button.getClientRects().length, "The button is visible"); 27 28 info("Switch the host to the right"); 29 await toolbox.switchHost("right"); 30 31 ok(!!button.getClientRects().length, "The button is still visible"); 32 ok( 33 button.classList.contains("pane-collapsed"), 34 "The button is still in collapsed state" 35 ); 36 });