[webkit-changes] [WebKit/WebKit] 874dbd: [iOS] Adjust several API tests so that they pass w...

Wenson Hsieh noreply at github.com
Wed May 24 07:13:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 874dbd53a389b72df8ec35cbe5b478f4d5327da5
      https://github.com/WebKit/WebKit/commit/874dbd53a389b72df8ec35cbe5b478f4d5327da5
  Author: Wenson Hsieh <wenson_hsieh at apple.com>
  Date:   2023-05-24 (Wed, 24 May 2023)

  Changed paths:
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm
    M Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/SnapshotViaRenderInContext.mm
    M Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

  Log Message:
  -----------
  [iOS] Adjust several API tests so that they pass when run against any iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=257246
rdar://109743641

Reviewed by Aditya Keerthi.

Make some additional adjustments to several API tests, which currently pass in the iPhone SE
simulator but fail when run against other simulator models. These tests are:

• A subset of `WKWebView.SnapshotImage*`
• A subset of `AnimatedResize.*`
• `WebKitLegacy.RenderInContextSnapshot`

* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:

Drive-by fix: address a (benign) build warning following 264080 at main, where the definition of
`-runFromElement:toElement` is compiled twice, due to the fact that `DragAndDropSimulator.mm`
appears in _both_ the unified sources list as well as the Xcode project as a compilation target.
Address this by removing it as a compilation target in Xcode.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:

Fix these tests by subclassing `TestWKWebView`, which normalizes safe area inset values between
different device models.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewSnapshot.mm:

Fix these tests by adopting `TestWKWebView` in place of `WKWebView`.

* Tools/TestWebKitAPI/Tests/WebKitLegacy/ios/SnapshotViaRenderInContext.mm:
(-[UIWebViewWithoutSafeArea _safeAreaInsetsForFrame:inSuperview:]):

Fix this test by creating a `UIWebView` subclass that simulates 0 safe area insets.

* Tools/TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView _safeAreaInsetsForFrame:inSuperview:]):

Override this private helper method instead of `-safeAreaInsets`, since this is the ultimate source
of truth that determines `-safeAreaInsets`. This is consistent with `WebKitTestRunner`'s
`TestRunnerWKWebView` subclass, which also has a mechanism for overriding safe area insets.

(-[TestWKWebView safeAreaInsets]): Deleted.

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




More information about the webkit-changes mailing list