Commit dfaa6bdd authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

Fix testWebViewIsFirstResponderUponKeyPress for iOS 11.3+

This CL fixes the testWebViewIsFirstResponderUponKeyPress test which was
failing for iOS 11.3+. The changes in iOS 11.3+ is that the WKWebView is
the first responder instead of the WKContentView.

Bug: 830124, 837564
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I9b5c343579657c5db9d3973820e5c67ae495bcb4
Reviewed-on: https://chromium-review.googlesource.com/1052008Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557169}
parent bdb8846a
......@@ -200,10 +200,16 @@ using chrome_test_util::SettingsDoneButton;
[self verifyKeyboardCommandsAreRegistered];
UIResponder* firstResponder = GetFirstResponder();
GREYAssert(
[firstResponder isKindOfClass:NSClassFromString(@"WKContentView")],
@"Expected first responder to be a WKContentView. Instead, is a %@",
NSStringFromClass([firstResponder class]));
if (@available(iOS 11.3, *)) {
GREYAssert([firstResponder isKindOfClass:NSClassFromString(@"WKWebView")],
@"Expected first responder to be a WKWebView. Instead, is a %@",
NSStringFromClass([firstResponder class]));
} else {
GREYAssert(
[firstResponder isKindOfClass:NSClassFromString(@"WKContentView")],
@"Expected first responder to be a WKContentView. Instead, is a %@",
NSStringFromClass([firstResponder class]));
}
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment