Title: [280986] trunk
Revision
280986
Author
[email protected]
Date
2021-08-12 14:13:45 -0700 (Thu, 12 Aug 2021)

Log 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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (280985 => 280986)


--- trunk/LayoutTests/ChangeLog	2021-08-12 20:49:58 UTC (rev 280985)
+++ trunk/LayoutTests/ChangeLog	2021-08-12 21:13:45 UTC (rev 280986)
@@ -1,3 +1,15 @@
+2021-08-12  Wenson Hsieh  <[email protected]>
+
+        [ 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.
+
+        Remove the flaky test failure expectations.
+
+        * platform/ios-wk2/TestExpectations:
+
 2021-08-12  Ayumi Kojima  <[email protected]>
 
         [ MacOS EWS ] inspector/canvas/recording-webgl-snapshots.html is flaky failing.

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (280985 => 280986)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2021-08-12 20:49:58 UTC (rev 280985)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2021-08-12 21:13:45 UTC (rev 280986)
@@ -1319,9 +1319,6 @@
 
 # <rdar://problem/56512107> [ iOS ] Three editing/pasteboard/smart-paste-paragraph tests have been flaky since they landed in r243124 (203264)
 webkit.org/b/203264 [ Release ] editing/pasteboard/smart-paste-paragraph-001.html [ Pass Failure ]
-webkit.org/b/228285 editing/pasteboard/smart-paste-paragraph-002.html [ Pass Failure ]
-webkit.org/b/228285 editing/pasteboard/smart-paste-paragraph-003.html [ Pass Failure ]
-webkit.org/b/228285 editing/pasteboard/smart-paste-paragraph-004.html [ Pass Failure ]
 
 # Timeout running prompt() because mock implementation is absent.
 webkit.org/b/203572 media/remoteplayback-prompt.html [ Skip ]

Modified: trunk/Source/WebKit/ChangeLog (280985 => 280986)


--- trunk/Source/WebKit/ChangeLog	2021-08-12 20:49:58 UTC (rev 280985)
+++ trunk/Source/WebKit/ChangeLog	2021-08-12 21:13:45 UTC (rev 280986)
@@ -1,3 +1,16 @@
+2021-08-12  Wenson Hsieh  <[email protected]>
+
+        [ 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.
+
+        Add SPI declarations. See Tools/ChangeLog for more details.
+
+        * Platform/spi/ios/TextInputSPI.h:
+        * Platform/spi/ios/UIKitSPI.h:
+
 2021-08-12  Said Abou-Hallawa  <[email protected]>
 
         [GPU Process] REGRESSION: WebContent often crashes when using iCloud photos

Modified: trunk/Source/WebKit/Platform/spi/ios/TextInputSPI.h (280985 => 280986)


--- trunk/Source/WebKit/Platform/spi/ios/TextInputSPI.h	2021-08-12 20:49:58 UTC (rev 280985)
+++ trunk/Source/WebKit/Platform/spi/ios/TextInputSPI.h	2021-08-12 21:13:45 UTC (rev 280986)
@@ -27,10 +27,16 @@
 
 #if USE(APPLE_INTERNAL_SDK)
 
+#import <TextInput/TIPreferencesController.h>
 #import <TextInput/TI_NSStringExtras.h>
 
 #else
 
+@protocol TIPreferencesControllerActions <NSObject>
+- (BOOL)oneTimeActionCompleted:(NSString *)actionKey;
+- (void)didTriggerOneTimeAction:(NSString *)actionKey;
+@end
+
 @interface NSString (TextInputDetails)
 - (BOOL)_containsCJScripts;
 - (BOOL)_containsCJScriptsOnly;

Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (280985 => 280986)


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2021-08-12 20:49:58 UTC (rev 280985)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2021-08-12 21:13:45 UTC (rev 280986)
@@ -1109,11 +1109,14 @@
 
 #endif
 
+@protocol TIPreferencesControllerActions;
+
 @interface UIKeyboardPreferencesController : NSObject
 + (UIKeyboardPreferencesController *)sharedPreferencesController;
 - (void)setValue:(id)value forPreferenceKey:(NSString *)key;
 - (BOOL)boolForPreferenceKey:(NSString *)key;
 - (id)valueForPreferenceKey:(NSString *)key;
+@property (nonatomic, readonly) UIKeyboardPreferencesController<TIPreferencesControllerActions> *preferencesActions;
 @end
 
 @interface UIMenuItem (UIMenuController_SPI)

Modified: trunk/Tools/ChangeLog (280985 => 280986)


--- trunk/Tools/ChangeLog	2021-08-12 20:49:58 UTC (rev 280985)
+++ trunk/Tools/ChangeLog	2021-08-12 21:13:45 UTC (rev 280986)
@@ -1,3 +1,26 @@
+2021-08-12  Wenson Hsieh  <[email protected]>
+
+        [ 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.
+
+        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):
+
 2021-08-12  Patrick Angle  <[email protected]>
 
         Add myself (Patrick Angle) to watchlist for Inspector code changes

Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (280985 => 280986)


--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2021-08-12 20:49:58 UTC (rev 280985)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2021-08-12 21:13:45 UTC (rev 280986)
@@ -32,6 +32,7 @@
 #import "PlatformWebView.h"
 #import "TestInvocation.h"
 #import "TestRunnerWKWebView.h"
+#import "TextInputSPI.h"
 #import "UIKitSPI.h"
 #import <Foundation/Foundation.h>
 #import <UIKit/UIKit.h>
@@ -164,6 +165,13 @@
         CFPreferencesSetAppValue((__bridge CFStringRef)automaticMinimizationEnabledPreferenceKey, kCFBooleanTrue, globalPreferencesDomainName);
     }
 
+    // Ensures that changing selection does not cause the software keyboard to appear,
+    // even when the hardware keyboard is attached.
+    auto hardwareKeyboardLastSeenPreferenceKey = @"HardwareKeyboardLastSeen";
+    auto preferencesActions = keyboardPreferences.preferencesActions;
+    if (![preferencesActions oneTimeActionCompleted:hardwareKeyboardLastSeenPreferenceKey])
+        [preferencesActions didTriggerOneTimeAction:hardwareKeyboardLastSeenPreferenceKey];
+
     // Disables the dictation keyboard shortcut for testing.
     auto dictationKeyboardShortcutPreferenceKey = @"HWKeyboardDictationShortcut";
     auto dictationKeyboardShortcutValueForTesting = @(-1);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to