Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 9a6df17ea66f2547902faee567e51e41c6ca5bf9
https://github.com/WebKit/WebKit/commit/9a6df17ea66f2547902faee567e51e41c6ca5bf9
Author: Wenson Hsieh <[email protected]>
Date: 2025-10-31 (Fri, 31 Oct 2025)
Changed paths:
M Tools/TestRunnerShared/cocoa/InstanceMethodSwizzler.h
M Tools/TestRunnerShared/cocoa/InstanceMethodSwizzler.mm
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
M Tools/TestWebKitAPI/Tests/ios/UIWKInteractionViewProtocol.mm
A Tools/TestWebKitAPI/ios/UIKitTestingHelpers.h
A Tools/TestWebKitAPI/ios/UIKitTestingHelpers.mm
Log Message:
-----------
REGRESSION(iOS26):
TestWebKitAPI.UIWKInteractionViewProtocol.UpdateSelectionWithExtentPoint is a
constant failure
https://bugs.webkit.org/show_bug.cgi?id=301654
rdar://163667371
Reviewed by Aditya Keerthi.
On iOS 26, `-[UIGestureRecognizer setState:]` is now a no-op in cases where the
gesture recognizer's
internal state doesn't allow for the state transition (based on the new
`Gestures.framework`). This
breaks several iOS API tests, which attempt to simulate gesture recognizer
state for testing.
To fix this, we change these tests to swizzle out `-[UIGestureRecognizer
state]` completely.
* Tools/TestRunnerShared/cocoa/InstanceMethodSwizzler.h:
* Tools/TestRunnerShared/cocoa/InstanceMethodSwizzler.mm:
(InstanceMethodSwapper::InstanceMethodSwapper):
(InstanceMethodSwapper::~InstanceMethodSwapper):
Add a variation of `InstanceMethodSwizzler` that allows clients to temporarily
swap two method
implementations (as opposed to temporarily replacing a method's
implementation); this helper class
makes it easy for clients to implement swizzling hooks that _may_ additionally
call into the
original method as a fallback.
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/ios/UIWKInteractionViewProtocol.mm:
(TestWebKitAPI::TEST(UIWKInteractionViewProtocol,
UpdateSelectionWithExtentPoint)):
(TestWebKitAPI::TEST(UIWKInteractionViewProtocol,
DISABLED_UpdateSelectionWithExtentPoint)): Deleted.
Adopt the new `-_setStateForTesting:` method below, instead of trying to set
the `state`
property directly.
* Tools/TestWebKitAPI/ios/UIKitTestingHelpers.h: Copied from
Tools/TestRunnerShared/cocoa/InstanceMethodSwizzler.h.
* Tools/TestWebKitAPI/ios/UIKitTestingHelpers.mm: Copied from
Tools/TestRunnerShared/cocoa/InstanceMethodSwizzler.mm.
(allStateOverrides):
(-[UIGestureRecognizer swizzled_state]):
(-[UIGestureRecognizer _setStateForTesting:]):
(-[UIGestureRecognizer _clearOverriddenStateForTesting]):
Add a new helper file that contains testing utilities for UIKit classes.
Currently, this just
contains two category methods on `UIGestureRecognizer` that allow us to
override the `-state`
property for testing purposes.
Canonical link: https://commits.webkit.org/302411@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications