Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 733eb9d3aa71130f0370ded79b6d9c14adedb494
      
https://github.com/WebKit/WebKit/commit/733eb9d3aa71130f0370ded79b6d9c14adedb494
  Author: Abrar Rahman Protyasha <[email protected]>
  Date:   2026-09-14 (Mon, 14 Sep 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
    M Source/WebKit/UIProcess/WebPageProxyTesting.cpp
    M Source/WebKit/UIProcess/WebPageProxyTesting.h
    M Source/WebKit/WebProcess/WebPage/WebPageTesting.cpp
    M Source/WebKit/WebProcess/WebPage/WebPageTesting.h
    M Source/WebKit/WebProcess/WebPage/WebPageTesting.messages.in
    M Tools/TestWebKitAPI/Helpers/cocoa/WebPage+Extras.swift
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SampledPageTopColor.mm
    M Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift

  Log Message:
  -----------
  Allow API tests to wait for synthetic momentum scrolling to end
https://bugs.webkit.org/show_bug.cgi?id=324123
rdar://187341638

Reviewed by Richard Robinson.

eventSender.monitorWheelEvents() in layout tests can ask for momentum
phase to end, but -_waitForWheelEventsToCompleteForTesting in WKWebView
testing support cannot, since it hardcodes the `expectMomentumEnd`
argument for waitForWheelEventsToCompleteForTesting to false.

In this patch, we plumb the request from API test callers through to
WebKit so that API tests can also wait for momentum phase to end.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm:
(-[WKWebView _waitForWheelEventsToCompleteForTesting:]):
(-[WKWebView _waitForWheelEventsAndMomentumToCompleteForTesting:]):
(-[WKWebView _startMonitoringWheelEventsForTestingWithCompletionHandler:]):
(-[WKWebView _waitForWheelEventsToCompleteForTestingWithCompletionHandler:]):
(-[WKWebView 
_waitForWheelEventsAndMomentumToCompleteForTestingWithCompletionHandler:]):
(-[WKWebView _startMonitoringWheelEventsForTesting:]): Deleted.
Add the `WithCompletionHandler:` suffix so that Swift imports them as
async functions, which the `forTesting:` argument label was suppressing.

* Source/WebKit/UIProcess/WebPageProxyTesting.cpp:
(WebKit::WebPageProxyTesting::waitForWheelEventsToCompleteForTesting):
* Source/WebKit/UIProcess/WebPageProxyTesting.h:
* Source/WebKit/WebProcess/WebPage/WebPageTesting.cpp:
(WebKit::WebPageTesting::waitForWheelEventsToCompleteForTesting):
* Source/WebKit/WebProcess/WebPage/WebPageTesting.h:
* Source/WebKit/WebProcess/WebPage/WebPageTesting.messages.in:
* Tools/TestWebKitAPI/Helpers/cocoa/WebPage+Extras.swift:
(startMonitoringWheelEvents):
(waitForScrollingToComplete(_:)):
(startMonitoring):
(waitForScrollingToComplete):

* Tools/TestWebKitAPI/Tests/WebKit/WebPage/AppKit Gesture 
Tests/BasicAppKitGesturesTests.swift:
(AppKitGesturesTests.scrollingChangesScrollPosition(_:)):
Retro-fit this test to now deterministically wait.

* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SampledPageTopColor.mm:
(TestWebKitAPI::scrollPageDown):
(TestWebKitAPI::TEST(SampledPageTopColor, 
TopScrollStretchingDoesNotPreventTopEdgeSampling)):

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



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

Reply via email to