Adjust compile and runtime flags to match shippable state of features (Part 2)
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2018 18:07:50 +0000 (18:07 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Jun 2018 18:07:50 +0000 (18:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186319
<rdar://problem/40352045>

Unreviewed test fix.

TestWebKitAPI was timing out because 'color' input types are no longer support. I also discovered that the
ASSERT_STREQ macro returns on error, which causes tests to time out whenever a 'done = true' call (needed to
end the test) is done after ASSERT_STREQ, which might fail and return early, preventing the flag from being
set.

* TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsTextField.mm:
(-[InjectedBundleNodeHandleIsTextField webProcessPlugIn:didCreateBrowserContextController:]): Make testing of
the 'color' input type conditional on the feature being part of the build.
* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(-[AutoFillDelegate _webView:didClickAutoFillButtonWithUserInfo:]): Set the 'done=true' state before performing
string equality assertions, since they do an early return and bypass the end state of the test.
(-[DidResignInputElementStrongPasswordAppearanceDelegate _webView:didResignInputElementStrongPasswordAppearanceWithUserInfo:]): Ditto.
(-[AutoFillAvailableDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): Ditto.
(-[InjectedBundleNodeHandleIsTextFieldDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): Ditto.

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

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsTextField.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm

index 89b532a..357f65e 100644 (file)
@@ -1,3 +1,26 @@
+2018-06-06  Brent Fulgham  <bfulgham@apple.com>
+
+        Adjust compile and runtime flags to match shippable state of features (Part 2)
+        https://bugs.webkit.org/show_bug.cgi?id=186319
+        <rdar://problem/40352045>
+
+        Unreviewed test fix.
+
+        TestWebKitAPI was timing out because 'color' input types are no longer support. I also discovered that the
+        ASSERT_STREQ macro returns on error, which causes tests to time out whenever a 'done = true' call (needed to
+        end the test) is done after ASSERT_STREQ, which might fail and return early, preventing the flag from being
+        set.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsTextField.mm:
+        (-[InjectedBundleNodeHandleIsTextField webProcessPlugIn:didCreateBrowserContextController:]): Make testing of
+        the 'color' input type conditional on the feature being part of the build.
+        * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
+        (-[AutoFillDelegate _webView:didClickAutoFillButtonWithUserInfo:]): Set the 'done=true' state before performing
+        string equality assertions, since they do an early return and bypass the end state of the test.
+        (-[DidResignInputElementStrongPasswordAppearanceDelegate _webView:didResignInputElementStrongPasswordAppearanceWithUserInfo:]): Ditto.
+        (-[AutoFillAvailableDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): Ditto.
+        (-[InjectedBundleNodeHandleIsTextFieldDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): Ditto.
+
 2018-06-05  Chris Dumez  <cdumez@apple.com>
 
         Regression(r232082): Websites get loaded inside of Messages App chat transcript
index a512c3d..a3a41e0 100644 (file)
@@ -77,7 +77,9 @@
     [self verifyTextFieldForHTMLInputType:@"week" document:document jsContext:jsContext expectedResult:YES failedInputTypes:failedInputTypes];
 
     [self verifyTextFieldForHTMLInputType:@"button" document:document jsContext:jsContext expectedResult:NO failedInputTypes:failedInputTypes];
+#if ENABLE_INPUT_TYPE_COLOR
     [self verifyTextFieldForHTMLInputType:@"color" document:document jsContext:jsContext expectedResult:NO failedInputTypes:failedInputTypes];
+#endif
     [self verifyTextFieldForHTMLInputType:@"file" document:document jsContext:jsContext expectedResult:NO failedInputTypes:failedInputTypes];
     [self verifyTextFieldForHTMLInputType:@"hidden" document:document jsContext:jsContext expectedResult:NO failedInputTypes:failedInputTypes];
     [self verifyTextFieldForHTMLInputType:@"image" document:document jsContext:jsContext expectedResult:NO failedInputTypes:failedInputTypes];
index b24cdd8..cb33c43 100644 (file)
@@ -523,9 +523,9 @@ static bool readyForClick;
 
 - (void)_webView:(WKWebView *)webView didClickAutoFillButtonWithUserInfo:(id <NSSecureCoding>)userInfo
 {
+    done = true;
     ASSERT_TRUE([(id<NSObject>)userInfo isKindOfClass:[NSString class]]);
     ASSERT_STREQ([(NSString*)userInfo UTF8String], "user data string");
-    done = true;
 }
 
 - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
@@ -560,9 +560,9 @@ static bool readytoResign;
 
 - (void)_webView:(WKWebView *)webView didResignInputElementStrongPasswordAppearanceWithUserInfo:(id <NSSecureCoding>)userInfo
 {
+    done = true;
     ASSERT_TRUE([(id<NSObject>)userInfo isKindOfClass:[NSString class]]);
     ASSERT_STREQ([(NSString*)userInfo UTF8String], "user data string");
-    done = true;
 }
 
 - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler
@@ -611,8 +611,8 @@ TEST(WebKit, DidResignInputElementStrongPasswordAppearanceWhenFormIsReset)
 - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)())completionHandler
 {
     completionHandler();
-    ASSERT_STREQ(message.UTF8String, "autofill available");
     done = true;
+    ASSERT_STREQ(message.UTF8String, "autofill available");
 }
 
 @end
@@ -635,8 +635,8 @@ TEST(WebKit, AutoFillAvailable)
 - (void)webView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)())completionHandler
 {
     completionHandler();
-    ASSERT_STREQ(message.UTF8String, "isTextField success");
     done = true;
+    ASSERT_STREQ(message.UTF8String, "isTextField success");
 }
 
 @end