diff options
Diffstat (limited to 'devtools/client/inspector/test/head.js')
-rw-r--r-- | devtools/client/inspector/test/head.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/devtools/client/inspector/test/head.js b/devtools/client/inspector/test/head.js index cb1b00030c..73c8902c6b 100644 --- a/devtools/client/inspector/test/head.js +++ b/devtools/client/inspector/test/head.js @@ -131,10 +131,12 @@ function pickElement(inspector, selector, x, y) { * X-offset from the top-left corner of the element matching the provided selector * @param {Number} y * Y-offset from the top-left corner of the element matching the provided selector + * @param {Object} eventOptions + * Options that will be passed to synthesizeMouse * @return {Promise} promise that resolves when both the "picker-node-hovered" and * "highlighter-shown" events are emitted. */ -async function hoverElement(inspector, selector, x, y) { +async function hoverElement(inspector, selector, x, y, eventOptions = {}) { const { waitForHighlighterTypeShown } = getHighlighterTestHelpers(inspector); info(`Waiting for element "${selector}" to be hovered`); const onHovered = inspector.toolbox.nodePicker.once("picker-node-hovered"); @@ -159,7 +161,7 @@ async function hoverElement(inspector, selector, x, y) { if (isNaN(x) || isNaN(y)) { BrowserTestUtils.synthesizeMouseAtCenter( selector, - { type: "mousemove" }, + { ...eventOptions, type: "mousemove" }, browsingContext ); } else { @@ -167,7 +169,7 @@ async function hoverElement(inspector, selector, x, y) { selector, x, y, - { type: "mousemove" }, + { ...eventOptions, type: "mousemove" }, browsingContext ); } |