haikuwebkit/Tools/WebKitTestRunner/ios
Wenson Hsieh 8fd4a9df7a [iOS 15] editing/selection/ios/select-all-in-readonly-input-does-not-overflow.html is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=229126
rdar://80384801

Reviewed by Tim Horton.

Source/WebKit:

Remove the (now-unused) testing SPI `-[WKWebView _doAfterResettingSingleTapGesture:]`. See Tools/ChangeLog for
more information.

* UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
* UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView _doAfterResettingSingleTapGesture:]): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _singleTapDidReset:]):
(-[WKContentView _doAfterResettingSingleTapGesture:]): Deleted.

Tools:

This test exercises the ability to cause platform selection views to show up after tapping the web view while a
DOM selection is set. In this codepath, selection views are installed when the web view becomes first responder,
when we call into `-[UIWKTextInteractionAssistant activateSelection]`; the call to `-becomeFirstResponder`, in
turn, comes from UIKit's internal `UITextTapRecognizer` gesture, which recognizes the single tap and makes the
content view first responder.

In the case where this test fails, the synthesized tap gesture fails to activate the text tap recognizer; this
happens because the timing of when the `UITextTapRecognizer` gets reset (i.e. `-_resetGestureRecognizer`) races
against the timing of when the synthesized touch event is sent to the gesture recognizer. When the touch is
delivered to the gesture *before* the text tap gesture is reset, we end up timing out because the text tap
gesture's action never fires and makes the content view first responder.

To ensure that we don't lose this race and time out, we augment the existing mechanism in
`UIScriptControllerIOS::waitForSingleTapToReset()` to wait for *all* enabled single tap (and single touch)
gestures to reset, instead of only waiting for the web view's synthetic click gesture. Importantly, this
includes `UITextTapRecognizer`, which ensures that the touches are delivered to the gesture only after the text
tap gesture has been reset (and transitions to Possible state).

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptControllerIOS::waitForSingleTapToReset const):

Instead of using testing SPI (`-_doAfterResettingSingleTapGesture:`) to wait for the single tap to reset, we can
just directly iterate through all the gestures on the content view and wait for all enabled single tap gestures
to transition back to Possible state.

LayoutTests:

Update test expectations for this flaky test.

* platform/ios-14/TestExpectations:
* platform/ios/TestExpectations:


Canonical link: https://commits.webkit.org/240529@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-16 03:34:05 +00:00
..
GeneratedTouchesDebugWindow.h
GeneratedTouchesDebugWindow.mm Use adoptNS() as soon as we [[ObjcClass alloc] init] to avoid leaks in Tools/ 2021-02-23 16:21:48 +00:00
HIDEventGenerator.h
HIDEventGenerator.mm Remove <wtf/Optional.h> 2021-06-02 06:45:51 +00:00
Launch.storyboard
PlatformWebViewIOS.mm [iOS] Unified field is unselected after focusing URL bar if text was selected in a fixed position container 2021-07-25 19:40:36 +00:00
TestControllerIOS.mm [ iOS Debug] 3 editing/pasteboard/smart-paste-paragraph tests are flaky failing 2021-08-12 21:13:45 +00:00
UIScriptControllerIOS.h Allow testing of the final UIView tree on iOS platforms 2021-08-12 20:16:51 +00:00
UIScriptControllerIOS.mm [iOS 15] editing/selection/ios/select-all-in-readonly-input-does-not-overflow.html is a flaky timeout 2021-08-16 03:34:05 +00:00
mainIOS.mm Unify linkedOnOrAfter duplicate code and use SPI/WebCoreTestSupport instead of NSUserDefaults 2020-10-05 14:57:53 +00:00