Closed
Bug 1704211
Opened 4 years ago
Closed 4 years ago
[meta] Stop synthesizing events on context menus in automated tests
Categories
(Core :: Widget: Cocoa, task, P2)
Core
Widget: Cocoa
Tracking
()
RESOLVED
FIXED
90 Branch
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox87 | --- | unaffected |
firefox88 | --- | unaffected |
firefox89 | --- | fixed |
firefox90 | --- | fixed |
People
(Reporter: mstange, Assigned: mstange)
References
Details
(Keywords: meta, Whiteboard: [proton-context-menus] [mac:mr1] [priority:2c])
On macOS, native context menus do not respond to synthesized events, such as mousemove, click, or key presses. However, we have many automated tests which use synthesized events to interact with context menus.
This bug tracks converting our existing tests to menu.openMenu(true)
for opening submenus, and popup.activateItem(menuitem)
(new from bug 1704206) for clicking items.
Example:
diff --git a/browser/components/extensions/test/browser/head.js b/browser/components/extensions/test/browser/head.js
--- a/browser/components/extensions/test/browser/head.js
+++ b/browser/components/extensions/test/browser/head.js
@@ -490,31 +490,31 @@ async function openExtensionContextMenu(
return null;
}
let extensionMenu = topLevelMenu[0];
let popupShownPromise = BrowserTestUtils.waitForEvent(
contextMenu,
"popupshown"
);
- EventUtils.synthesizeMouseAtCenter(extensionMenu, {});
+ extensionMenu.openMenu(true);
await popupShownPromise;
return extensionMenu;
}
async function closeExtensionContextMenu(itemToSelect, modifiers = {}) {
let contentAreaContextMenu = document.getElementById(
"contentAreaContextMenu"
);
let popupHiddenPromise = BrowserTestUtils.waitForEvent(
contentAreaContextMenu,
"popuphidden"
);
if (itemToSelect) {
- EventUtils.synthesizeMouseAtCenter(itemToSelect, modifiers);
+ contentAreaContextMenu.activateItem(itemToSelect, modifiers);
} else {
contentAreaContextMenu.hidePopup();
}
await popupHiddenPromise;
// Bug 1351638: parent menu fails to close intermittently, make sure it does.
contentAreaContextMenu.hidePopup();
}
Updated•4 years ago
|
See Also: → https://jira.mozilla.com/browse/FIDEFE-1142
Updated•4 years ago
|
Priority: -- → P2
Whiteboard: [proton-context-menus][mac:mr1] → [proton-context-menus] [mac:mr1] [priority:2c]
Assignee | ||
Comment 1•4 years ago
|
||
This is done. At least half of the patches under bugs blocking bug 1700724 fell under this category.
Assignee: nobody → mstange.moz
Status: NEW → RESOLVED
Closed: 4 years ago
status-firefox87:
--- → unaffected
status-firefox88:
--- → unaffected
status-firefox89:
--- → affected
status-firefox90:
--- → fixed
status-firefox-esr78:
--- → unaffected
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Updated•4 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•