Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS 16] All layout tests in fast/events/ios/rotation time out #1957

Merged
merged 1 commit into from
Jun 30, 2022

Commits on Jun 30, 2022

  1. [iOS 16] All layout tests in fast/events/ios/rotation time out

    https://bugs.webkit.org/show_bug.cgi?id=242199
    rdar://93784344
    
    Reviewed by Devin Rousso and Tim Horton.
    
    For all apps linked on or after iOS 16, `-[UIDevice setOrientation:animated:]` is a no-op; this
    causes all layout tests that attempt to simulate rotation (i.e., all the tests inside
    fast/events/ios/rotation) to time out while waiting for the web view to resize during rotation.
    
    In its place, UIKit has added `-[UIWindowScene requestGeometryUpdateWithPreferences:errorHandler:]`,
    which can be used to request a scene-level transition to one or more requested interface
    orientations; fix these failing layout tests by adopting this API instead on iOS 16.
    
    * Source/WTF/wtf/PlatformHave.h:
    
    Add a new build-time flag to guard the availability of the new UIKit API.
    
    * Tools/WebKitTestRunner/ios/TestControllerIOS.mm:
    (WTR::restorePortraitOrientationIfNeeded):
    (WTR::TestController::platformResetStateToConsistentValues):
    
    Additionally refactor logic for restoring device orientation to portrait mode between tests, so that
    it's also compatible with iOS 16.
    
    * Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h:
    * Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:
    (WTR::UIScriptControllerIOS::simulateRotation):
    (WTR::UIScriptControllerIOS::simulateRotationLikeSafari):
    
    Factor out common logic into a private helper method; use `-requestGeometryUpdateWithPreferences:`
    on iOS 16, and fall back to `-setOrientation:animated:` elsewhere.
    
    (WTR::toWindowSceneGeometryPreferences):
    (WTR::toUIDeviceOrientation):
    
    Canonical link: https://commits.webkit.org/252016@main
    whsieh committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    b751dd0 View commit details
    Browse the repository at this point in the history