[webkit-changes] [WebKit/WebKit] 0a8af7: Add Unit Test Support for StageMode Interaction

Phipson noreply at github.com
Tue Feb 25 13:41:55 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0a8af7554b376e95b170d006e17816e4a7b4878d
      https://github.com/WebKit/WebKit/commit/0a8af7554b376e95b170d006e17816e4a7b4878d
  Author: Phipson Lee <phipsonleecy at gmail.com>
  Date:   2025-02-25 (Tue, 25 Feb 2025)

  Changed paths:
    M Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebKit/stagemode-model-page.html
    M Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm
    M Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h
    M Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm

  Log Message:
  -----------
  Add Unit Test Support for StageMode Interaction
https://bugs.webkit.org/show_bug.cgi?id=287943
rdar://145113469

Reviewed by Wenson Hsieh and Ada Chan.

This PR adds support for unit tests for stagemode interaction. It leverages existing APIs for Drag and Drop
but adds additional calls to simulate the pan gesture recognizer for model interaction. Subsequent PRs will
be made to add additional support for testing correct behavior when mapping XY translation to rotation.

* Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView _simulatePanGestureBeginAtPoint:]):
(-[WKWebView _simulatePanGestureUpdateAtPoint:]):
(-[WKWebView _stageModeInfoForTesting]):
- Adds calls into the WKContentView to start and update the pan gesture
- Also adds a call to fetch information about the stageModeSession packaged as a dictionary

* Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST(DragAndDropTests, IgnoreHitTestStageModeModel)):
(TestWebKitAPI::TEST(DragAndDropTests, CanHitTestStageModeModel)):
- Adds unit tests to verify whether the returned information for stage mode is correct based on hit-testing

* Tools/TestWebKitAPI/cocoa/DragAndDropSimulator.h:
* Tools/TestWebKitAPI/ios/DragAndDropSimulatorIOS.mm:
(-[DragAndDropSimulator hitTestForStageModeAt:]):
(-[DragAndDropSimulator awaitingStageModeHitResult]):
(-[DragAndDropSimulator stageModeHitTestValidModel]):
- Adds additional APIs to the simulator to call into the WKWebView's testing API to simulate a pan

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list