⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280986 in webkit


Ignore:
Timestamp:
Aug 12, 2021, 2:13:45 PM (5 years ago)
Author:
Wenson Hsieh
Message:

[ iOS Debug] 3 editing/pasteboard/smart-paste-paragraph tests are flaky failing
https://bugs.webkit.org/show_bug.cgi?id=228285
rdar://81118724

Reviewed by Tim Horton and Aditya Keerthi.

Source/WebKit:

Add SPI declarations. See Tools/ChangeLog for more details.

  • Platform/spi/ios/TextInputSPI.h:
  • Platform/spi/ios/UIKitSPI.h:

Tools:

These three editing tests occasionally fail when synthesizing a double-tap gesture in order to select a word in
editable content. This happens because unless UIKit has observed at least one keypress event (e.g. from a
previous editing test), it presents the software keyboard underneath -[UIKeyboardImpl showKeyboardIfNeeded]
when setting the selection via UITextSelectionInteraction. This causes the input view frame to expand from the
collapsed (UCB) height of 44pt to the full software keyboard height, which in turn causes the second touch in
the synthesized double tap gesture to _sometimes_ hit-test to the wrong location, resulting in these test
failures.

To mitigate this, ensure that we have consistent behavior in layout tests when changing the text selection in
editable content by directly setting a TextInput default to make the keyboard behave as if it has previously
seen a keypress via the hardware keyboard.

  • WebKitTestRunner/ios/TestControllerIOS.mm:

(WTR::TestController::platformResetStateToConsistentValues):

LayoutTests:

Remove the flaky test failure expectations.

  • platform/ios-wk2/TestExpectations:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r280985 r280986  
     12021-08-12  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [ iOS Debug] 3 editing/pasteboard/smart-paste-paragraph tests are flaky failing
     4        https://bugs.webkit.org/show_bug.cgi?id=228285
     5        rdar://81118724
     6
     7        Reviewed by Tim Horton and Aditya Keerthi.
     8
     9        Remove the flaky test failure expectations.
     10
     11        * platform/ios-wk2/TestExpectations:
     12
    1132021-08-12  Ayumi Kojima  <ayumi_kojima@apple.com>
    214
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r280937 r280986  
    13201320# <rdar://problem/56512107> [ iOS ] Three editing/pasteboard/smart-paste-paragraph tests have been flaky since they landed in r243124 (203264)
    13211321webkit.org/b/203264 [ Release ] editing/pasteboard/smart-paste-paragraph-001.html [ Pass Failure ]
    1322 webkit.org/b/228285 editing/pasteboard/smart-paste-paragraph-002.html [ Pass Failure ]
    1323 webkit.org/b/228285 editing/pasteboard/smart-paste-paragraph-003.html [ Pass Failure ]
    1324 webkit.org/b/228285 editing/pasteboard/smart-paste-paragraph-004.html [ Pass Failure ]
    13251322
    13261323# Timeout running prompt() because mock implementation is absent.
  • trunk/Source/WebKit/ChangeLog

    r280981 r280986  
     12021-08-12  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [ iOS Debug] 3 editing/pasteboard/smart-paste-paragraph tests are flaky failing
     4        https://bugs.webkit.org/show_bug.cgi?id=228285
     5        rdar://81118724
     6
     7        Reviewed by Tim Horton and Aditya Keerthi.
     8
     9        Add SPI declarations. See Tools/ChangeLog for more details.
     10
     11        * Platform/spi/ios/TextInputSPI.h:
     12        * Platform/spi/ios/UIKitSPI.h:
     13
    1142021-08-12  Said Abou-Hallawa  <said@apple.com>
    215
  • trunk/Source/WebKit/Platform/spi/ios/TextInputSPI.h

    r180441 r280986  
    2828#if USE(APPLE_INTERNAL_SDK)
    2929
     30#import <TextInput/TIPreferencesController.h>
    3031#import <TextInput/TI_NSStringExtras.h>
    3132
    3233#else
     34
     35@protocol TIPreferencesControllerActions <NSObject>
     36- (BOOL)oneTimeActionCompleted:(NSString *)actionKey;
     37- (void)didTriggerOneTimeAction:(NSString *)actionKey;
     38@end
    3339
    3440@interface NSString (TextInputDetails)
  • trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h

    r280767 r280986  
    11101110#endif
    11111111
     1112@protocol TIPreferencesControllerActions;
     1113
    11121114@interface UIKeyboardPreferencesController : NSObject
    11131115+ (UIKeyboardPreferencesController *)sharedPreferencesController;
     
    11151117- (BOOL)boolForPreferenceKey:(NSString *)key;
    11161118- (id)valueForPreferenceKey:(NSString *)key;
     1119@property (nonatomic, readonly) UIKeyboardPreferencesController<TIPreferencesControllerActions> *preferencesActions;
    11171120@end
    11181121
  • trunk/Tools/ChangeLog

    r280983 r280986  
     12021-08-12  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [ iOS Debug] 3 editing/pasteboard/smart-paste-paragraph tests are flaky failing
     4        https://bugs.webkit.org/show_bug.cgi?id=228285
     5        rdar://81118724
     6
     7        Reviewed by Tim Horton and Aditya Keerthi.
     8
     9        These three editing tests occasionally fail when synthesizing a double-tap gesture in order to select a word in
     10        editable content. This happens because unless UIKit has observed at least one keypress event (e.g. from a
     11        previous editing test), it presents the software keyboard underneath `-[UIKeyboardImpl showKeyboardIfNeeded]`
     12        when setting the selection via UITextSelectionInteraction. This causes the input view frame to expand from the
     13        collapsed (UCB) height of 44pt to the full software keyboard height, which in turn causes the second touch in
     14        the synthesized double tap gesture to _sometimes_ hit-test to the wrong location, resulting in these test
     15        failures.
     16
     17        To mitigate this, ensure that we have consistent behavior in layout tests when changing the text selection in
     18        editable content by directly setting a TextInput default to make the keyboard behave as if it has previously
     19        seen a keypress via the hardware keyboard.
     20
     21        * WebKitTestRunner/ios/TestControllerIOS.mm:
     22        (WTR::TestController::platformResetStateToConsistentValues):
     23
    1242021-08-12  Patrick Angle  <pangle@apple.com>
    225
  • trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm

    r280867 r280986  
    3333#import "TestInvocation.h"
    3434#import "TestRunnerWKWebView.h"
     35#import "TextInputSPI.h"
    3536#import "UIKitSPI.h"
    3637#import <Foundation/Foundation.h>
     
    165166    }
    166167
     168    // Ensures that changing selection does not cause the software keyboard to appear,
     169    // even when the hardware keyboard is attached.
     170    auto hardwareKeyboardLastSeenPreferenceKey = @"HardwareKeyboardLastSeen";
     171    auto preferencesActions = keyboardPreferences.preferencesActions;
     172    if (![preferencesActions oneTimeActionCompleted:hardwareKeyboardLastSeenPreferenceKey])
     173        [preferencesActions didTriggerOneTimeAction:hardwareKeyboardLastSeenPreferenceKey];
     174
    167175    // Disables the dictation keyboard shortcut for testing.
    168176    auto dictationKeyboardShortcutPreferenceKey = @"HWKeyboardDictationShortcut";
Note: See TracChangeset for help on using the changeset viewer.