Closed Bug 1703333 Opened 4 years ago Closed 4 years ago

Allow tests to exercise more control over native context menus

Categories

(Core :: Widget: Cocoa, task)

All
macOS
task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(3 files)

At the moment it is not possible for tests to close native context menus, because popupElement.hidePopup() doesn't do anything. Furthermore, popupElement.state currently always returns "closed" which is also counter to test expectations.

This bug aims to fix those two issues.

I introduced this assertion in bug 1702041, thinking that cancelTracking would
synchronously call menuDidClose, but that's not the case. The only reason why
this assertion isn't failing today is because we currently only call Close() on
NativeMenu in the "rollup from mousedown" scenario, where the menu has already
been closed by the OS, and we're just waiting to dispatch the MenuClosedAsync()
runnable.

This fixes tests which query popupElement.state.
Only the "root" menupopup is updated; the state for submenus is still always "closed".

Depends on D110973

Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/d792d54ec7cf Remove misguided assertion; -[NSMenu cancelTracking] is asynchronous. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/6c92f18636a8 Make the popup state reflect reality for native context menus. r=tnikkel https://hg.mozilla.org/integration/autoland/rev/593f90bd80e8 Make popupElement.hidePopup() work for native menus. A lot of tests rely on this. r=tnikkel
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: