MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / getMenu

Function getMenu

front_end/testing/ContextMenuHelpers.ts:8–15  ·  view source on GitHub ↗
(action: () => void)

Source from the content-addressed store, hash-verified

6import * as UI from '../ui/legacy/legacy.js';
7
8export function getMenu(action: () => void): UI.ContextMenu.ContextMenu {
9 const sandbox = sinon.createSandbox();
10
11 const contextMenuShow = sandbox.stub(UI.ContextMenu.ContextMenu.prototype, 'show').resolves();
12 action();
13 sandbox.restore();
14 return contextMenuShow.thisValues[0];
15}
16
17export function getMenuForToolbarButton(button: UI.Toolbar.ToolbarMenuButton): UI.ContextMenu.ContextMenu {
18 return getMenu(() => {

Callers 4

getMenuForToolbarButtonFunction · 0.85
getContextMenuForElementFunction · 0.85
getMenuForShiftClickFunction · 0.85

Calls 1

restoreMethod · 0.45

Tested by

no test coverage detected