[webkit-changes] [WebKit/WebKit] ab2e98: ContextMenuTests.SharePopoverDoesNotClearSelection...

Wenson Hsieh noreply at github.com
Fri Feb 3 13:10:14 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ab2e98f51ffb9d9315b44fd88598ac2c68fac9a4
      https://github.com/WebKit/WebKit/commit/ab2e98f51ffb9d9315b44fd88598ac2c68fac9a4
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-02-03 (Fri, 03 Feb 2023)

  Changed paths:
    M Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h
    M Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm

  Log Message:
  -----------
  ContextMenuTests.SharePopoverDoesNotClearSelection times out in some versions of macOS
https://bugs.webkit.org/show_bug.cgi?id=251690
rdar://104987312

Reviewed by Aditya Keerthi.

After some refactoring in system share sheet, `SHKSharingServicePicker` no longer shows a popover if
it can't find a presenting view, by asking the menu item's `NSMenu` for its `-_presentingView`.
However, in the case where the menu item is programmatically invoked, the presenting view seems to
be `nil`, which breaks this API test, since it needs to verify that presenting the share sheet
popover does not erroneously clear out the active text selection.

To keep this test passing after these recent system changes, we swizzle `-[NSMenu _presentingView]`
to force the share sheet popover to appear next to the web view.

* Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h:
* Tools/TestWebKitAPI/Tests/mac/ContextMenuTests.mm:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/259834@main




More information about the webkit-changes mailing list