[webkit-changes] [WebKit/WebKit] 586aa0: [ iOS18 ] 3x TestWebKitAPI.WebKit.ScrollTo* (api-t...

Aditya Keerthi noreply at github.com
Fri Dec 13 16:18:35 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 586aa00275b46a60eca5c692d81de42e51882171
      https://github.com/WebKit/WebKit/commit/586aa00275b46a60eca5c692d81de42e51882171
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-12-13 (Fri, 13 Dec 2024)

  Changed paths:
    M Tools/TestRunnerShared/spi/UIKitSPIForTesting.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm

  Log Message:
  -----------
  [ iOS18 ] 3x TestWebKitAPI.WebKit.ScrollTo* (api-tests) are constant timeouts
https://bugs.webkit.org/show_bug.cgi?id=284410
rdar://141248187

Reviewed by Wenson Hsieh.

Since TestWebKitAPI is not a real `UIApplication`, UIKit gets into a state
where its own update cycle is enabled (which is not runtime configurable), but
not started (which is done in `UIApplicationMain()`).

This means that `UIAnimation`-driven animations (like scroll view animations)
will never reach completion, and `scrollViewDidEndScrollingAnimation:` will
never be called.

Fix by leveraging the fact that UIKit's update cycle is not used for
`UIAnimation`s if `-[UIScreen _isEmbeddedScreen]` is false. This will result in
UIKit using a `CADisplayLink` to drive animations, and ensures completion is
reached without needing to be a `UIApplication`.

* Tools/TestRunnerShared/spi/UIKitSPIForTesting.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/FindInPage.mm:
(swizzledIsEmbeddedScreen):
(-[TestScrollViewDelegate init]):

Swizzle out `-[UIScreen _isEmbeddedScreen]` to force UIKit to use a
`CADisplayLink` to drive animations.

(TEST(WebKit, ScrollToFoundRangeWithExistingSelection)):
(TEST(WebKit, ScrollToFoundRangeDoesNotFocusElement)):
(TEST(WebKit, ScrollToFoundRangeRepeated)):

Canonical link: https://commits.webkit.org/287822@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