Should widget.macos.native-context-menus default to false when running with --headless (MOZ_HEADLESS=1)
Categories
(Core :: Widget: Cocoa, defect, P3)
Tracking
()
People
(Reporter: robwu, Unassigned, NeedInfo)
Details
The expectation when tests are running in headless mode is that there is no UI and such that could interfere.
When a test opens a context menu on macOS, a native context menu however appears on the screen.
I currently pass --setpref=widget.macos.native-context-menus=false
to ./mach test
to get the expected behavior, and wonder whether this should be the expected behavior by default.
Comment 1•21 days ago
|
||
Do you mean the default for tests? Or for regular users as well? If the latter, the answer is a confident no since we put a lot of effort into moving to native context menus (see bug 1700679 and related).
Reporter | ||
Comment 2•21 days ago
|
||
Not the default for all tests, just when --headless
or MOZ_HEADLESS=1 is used. In CI, there are separate jobs for both of them.
An example of documentation for headless mode is at https://firefox-source-docs.mozilla.org/remote/Testing.html#browser-chrome-mochitests
The purpose of headless mode is that no UI is visible, and popping up context menus on the screen goes against it.
An example of a scenario is, as a Firefox developer I want to run unit tests in the background while editing source code. If a context menu pops up, it takes away focus from my editor, which defeats the point of running with --headless
.
If you want to try it out locally, here is an example:
./mach test --headless browser/components/extensions/test/browser/browser_ext_menus_activeTab.js
If you run it, you will briefly see a native context menu flickering on the screen. That UI is not shown when run with:
./mach test --headless browser/components/extensions/test/browser/browser_ext_menus_activeTab.js --setpref=widget.macos.native-context-menus=false
Comment 3•21 days ago
|
||
Thanks! I think the one question that we should answer on the widget side is whether or not we would like to add a check before displaying native context menus to see if we're running in headless mode, and suppress them if that's the case. If not, we could move this bug to the Testing product and add this flag by default for headless tests. Markus, do you have any thoughts here?
Updated•15 days ago
|
Description
•