Skip to content

Commit

Permalink
REGRESSION (268971@main): [ iOS ] TestWebKitAPI.iOSMouseSupport.Mouse…
Browse files Browse the repository at this point in the history
…DidMoveOverElement is a consistent timeout

https://bugs.webkit.org/show_bug.cgi?id=273839
rdar://127691561

Reviewed by Megan Gardner and Richard Robinson.

The changes to `MouseEventTestHarness` in 268971@main made this API test time out, but only on iPad.
That's because UIKit adds its own `UIHoverGestureRecognizer` subclasses to `WKContentView` on iPad,
which causes the logic in the constructor of `MouseEventTestHarness` to initialize
`m_hoverGestureRecognizer` to the wrong gesture. Subsequently, attempts to simulate mouse movement
using this gesture recognizer fails to call into `WKMouseInteraction` delegate methods.

To fix this, simply adjust this logic to check the name of the gesture recognizer (`"WKMouseHover"`)
instead of relying on the class and `allowedTouchTypes`.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm:
(TestWebKitAPI::MouseEventTestHarness::MouseEventTestHarness):

Canonical link: https://commits.webkit.org/278651@main
  • Loading branch information
whsieh committed May 11, 2024
1 parent e4580b8 commit 7ee2bbe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Tools/TestWebKitAPI/Tests/WebKitCocoa/iOSMouseSupport.mm
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ - (UIPointerInteraction *)pointerInteraction
}

for (UIGestureRecognizer *gestureRecognizer in contentView.gestureRecognizers) {
auto hoverGestureRecognizer = dynamic_objc_cast<UIHoverGestureRecognizer>(gestureRecognizer);
if ([hoverGestureRecognizer.allowedTouchTypes containsObject:@(UITouchTypeIndirectPointer)])
m_hoverGestureRecognizer = hoverGestureRecognizer;
if ([gestureRecognizer.name isEqualToString:@"WKMouseHover"])
m_hoverGestureRecognizer = dynamic_objc_cast<UIHoverGestureRecognizer>(gestureRecognizer);
else if ([gestureRecognizer.name isEqualToString:@"WKMouseTouch"])
m_mouseTouchGestureRecognizer = gestureRecognizer;
}
Expand Down

0 comments on commit 7ee2bbe

Please sign in to comment.