REGRESSION (r243153): [iOS] TestWebKitAPI.FocusPreservationTests.ChangingFocusedNodeR...
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2019 22:48:04 +0000 (22:48 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Mar 2019 22:48:04 +0000 (22:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196031
<rdar://problem/49078172>

Reviewed by Tim Horton.

The test incorrectly assumes that calling -[WKWebView resignFirstResponder] is identical to dismissing the
<select> picker. This is no longer the case following r243135. Instead use testing SPI that invokes that
same code path used when the Done button is pressed to dismiss the <select> picker.

* TestWebKitAPI/Tests/ios/FocusPreservationTests.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243248 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/ios/FocusPreservationTests.mm

index 79bbb08..03b07f6 100644 (file)
@@ -1,3 +1,18 @@
+2019-03-20  Daniel Bates  <dabates@apple.com>
+
+        REGRESSION (r243153): [iOS] TestWebKitAPI.FocusPreservationTests.ChangingFocusedNodeResetsFocusPreservationState is failing
+        https://bugs.webkit.org/show_bug.cgi?id=196031
+        <rdar://problem/49078172>
+
+        Reviewed by Tim Horton.
+
+        The test incorrectly assumes that calling -[WKWebView resignFirstResponder] is identical to dismissing the
+        <select> picker. This is no longer the case following r243135. Instead use testing SPI that invokes that
+        same code path used when the Done button is pressed to dismiss the <select> picker.
+
+        * TestWebKitAPI/Tests/ios/FocusPreservationTests.mm:
+        (TestWebKitAPI::TEST):
+
 2019-03-20  Chris Dumez  <cdumez@apple.com>
 
         Regression(PSON): ViewGestureController is not properly notified of process swaps on iOS
index acdb04a..a585245 100644 (file)
@@ -96,7 +96,7 @@ TEST(FocusPreservationTests, ChangingFocusedNodeResetsFocusPreservationState)
 
     EXPECT_NOT_NULL(webView.textInputContentView.inputView);
     [webView selectFormAccessoryPickerRow:1];
-    EXPECT_TRUE([webView resignFirstResponder]);
+    [webView dismissFormAccessoryView];
     EXPECT_FALSE([webView stringByEvaluatingJavaScript:@"document.activeElement == document.querySelector('select')"].boolValue);
     EXPECT_EQ(1, [webView stringByEvaluatingJavaScript:@"document.querySelector('select').selectedIndex"].intValue);