browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js (1605B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 /* import-globals-from helper-collapsibilities.js */ 7 Services.scriptloader.loadSubScript( 8 CHROME_URL_ROOT + "helper-collapsibilities.js", 9 this 10 ); 11 12 /** 13 * Test that the split console key shortcut works on about:devtools-toolbox. 14 */ 15 add_task(async function () { 16 info("Force all debug target panes to be expanded"); 17 prepareCollapsibilitiesTest(); 18 19 const { document, tab, window } = await openAboutDebugging(); 20 await selectThisFirefoxPage(document, window.AboutDebugging.store); 21 const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( 22 document, 23 tab, 24 window 25 ); 26 27 // Select any tool that is not the Webconsole, since we will assert the split-console. 28 info("Select inspector tool"); 29 const toolbox = getToolbox(devtoolsWindow); 30 await toolbox.selectTool("inspector"); 31 32 info("Press Escape and wait for the split console to be opened"); 33 const onSplitConsole = toolbox.once("split-console"); 34 EventUtils.synthesizeKey("VK_ESCAPE", {}, devtoolsWindow); 35 await onSplitConsole; 36 await waitUntil(() => toolbox.isSplitConsoleFocused()); 37 ok(true, "Split console is opened and focused"); 38 39 info("Press Escape again and wait for the split console to be closed"); 40 EventUtils.synthesizeKey("VK_ESCAPE", {}, devtoolsWindow); 41 await waitUntil(() => !toolbox.isSplitConsoleFocused()); 42 ok(true, "Split console is closed and no longer focused"); 43 44 await closeAboutDevtoolsToolbox(document, devtoolsTab, window); 45 await removeTab(tab); 46 });