Closed Bug 1698668 Opened 3 years ago Closed 3 years ago

Improve native menu tests

Categories

(Core :: Widget: Cocoa, task)

All
macOS
task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

(Whiteboard: [proton-context-menus][mac:mr1] )

Attachments

(10 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
No description provided.

These functions aren't used by anything but they can be used during debugging.

Example output:

NSMenuItem [0x136263660] (no title)       [hasSubmenu]
  NSMenu [0x13079ec00] (no title)
    [0] NSMenuItem [0x13666cac0] Foo              [hasSubmenu]
      NSMenu [0x13079ec40] Foo
        [0] NSMenuItem [0x137093c10] FooItem0
        [1] NSMenuItem [0x1372a5dd0] FooItem1
        [2] NSMenuItem [0x1372a5a50] ----
        [3] NSMenuItem [0x1372a50b0] Bar              [hasSubmenu]
          NSMenu [0x13711ae00] Bar
            [0] NSMenuItem [0x1372a5890] BarItem0
            [1] NSMenuItem [0x1372a57b0] BarItem1

Depends on D108551

Blocks: 34572

This could already be achieved by calling standaloneNativeMenu.menuOpened(),
except for the MenuClosed() call.

Depends on D108729

Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/0dadedbc2296
Replace tabs with spaces in this test. r=harry
https://hg.mozilla.org/integration/autoland/rev/b34bb3f93d93
Add an activateItem function to this test which returns the activated command, and use it in testItem. r=harry
https://hg.mozilla.org/integration/autoland/rev/578e3c253d63
Replace most uses of testItem with uses of is and activateItem, for better errors messages. r=harry
https://hg.mozilla.org/integration/autoland/rev/323aec581a72
Add (unused) Dump methods to nsMenuX and nsMenuItemX that can be used during debugging. r=harry
https://hg.mozilla.org/integration/autoland/rev/2103e73c06eb
Add two helper methods to nsMenuUtilsX that print out the native menu tree. r=harry
https://hg.mozilla.org/integration/autoland/rev/f23864cbe0aa
Check the consistency of the native menu structure at the beginning of ActivateNativeMenuItemAt, both for the native menu bar and for standalone native menus. r=harry
https://hg.mozilla.org/integration/autoland/rev/9e5748ce4162
Reject out-of-range indexes when walking a menu path. r=harry
https://hg.mozilla.org/integration/autoland/rev/297659ddd8cd
Add a standaloneNativeMenu.dump() method that can be called from a test for debugging purposes. r=harry
https://hg.mozilla.org/integration/autoland/rev/415cd8195d36
Allow calling nsStandaloneNativeMenu::ForceUpdateNativeMenuAt with an empty string, to force rebuilding of the root menu. r=harry
https://hg.mozilla.org/integration/autoland/rev/1f3def02a98d
Adjust indexes in this subtest so that we can remove the todo_. r=harry
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: