browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js (1384B)
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 context menu of markup view on about:devtools-toolbox page. 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 info("Select inspector tool"); 28 const toolbox = getToolbox(devtoolsWindow); 29 await toolbox.selectTool("inspector"); 30 31 info("Show context menu of markup view"); 32 const markupDocument = toolbox.getPanel("inspector").markup.doc; 33 EventUtils.synthesizeMouseAtCenter( 34 markupDocument.body, 35 { type: "contextmenu" }, 36 markupDocument.ownerGlobal 37 ); 38 39 info("Check whether proper context menu of markup view will be shown"); 40 await waitUntil(() => toolbox.topDoc.querySelector("#node-menu-edithtml")); 41 ok(true, "Context menu of markup view should be shown"); 42 43 await closeAboutDevtoolsToolbox(document, devtoolsTab, window); 44 await removeTab(tab); 45 });