browser_markup_keybindings_02.js (1170B)
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 pressing ESC when a node in the markup-view is focused toggles 7 // the split-console (see bug 988278) 8 9 const TEST_URL = "data:text/html;charset=utf8,<div></div>"; 10 11 add_task(async function () { 12 const { inspector, toolbox } = await openInspectorForURL(TEST_URL); 13 14 info("Focusing the tag editor of the test element"); 15 const { editor } = await getContainerForSelector("div", inspector); 16 editor.tag.focus(); 17 18 info("Pressing ESC and wait for the split-console to open"); 19 let onSplitConsole = toolbox.once("split-console"); 20 const onConsoleReady = toolbox.once("webconsole-ready"); 21 EventUtils.synthesizeKey("VK_ESCAPE", {}, inspector.panelWin); 22 await onSplitConsole; 23 await onConsoleReady; 24 ok(toolbox.splitConsole, "The split console is shown."); 25 26 info("Pressing ESC again and wait for the split-console to close"); 27 onSplitConsole = toolbox.once("split-console"); 28 EventUtils.synthesizeKey("VK_ESCAPE", {}, inspector.panelWin); 29 await onSplitConsole; 30 ok(!toolbox.splitConsole, "The split console is hidden."); 31 });