Commit 88fdfb0d authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

ios: Disable making the webState first responder on iOS14.

This is currently causing a number of EG2 tests to spin.  Temporarily
disable while we investigate.

Bug: 1103822
Change-Id: I5b1bffe2b679b2970566e6d2687c37aca63d2670
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2295746
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#787907}
parent 60fa32c0
......@@ -10,6 +10,7 @@
#import <MaterialComponents/MaterialSnackbar.h>
#include "base/base64.h"
#include "base/ios/ios_util.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
#include "base/metrics/histogram_macros.h"
......@@ -3400,15 +3401,19 @@ NSString* const kBrowserViewControllerSnackbarCategory =
// If there is no first responder, try to make the webview or the NTP first
// responder to have it answer keyboard commands (e.g. space bar to scroll).
if (!GetFirstResponder() && self.currentWebState) {
NewTabPageTabHelper* NTPHelper =
NewTabPageTabHelper::FromWebState(webState);
if (NTPHelper && NTPHelper->IsActive()) {
UIViewController* viewController =
_ntpCoordinatorsForWebStates[webState].viewController;
[viewController becomeFirstResponder];
} else {
[self.currentWebState->GetWebViewProxy() becomeFirstResponder];
// TODO(crbug.com/1103822): Investigate why this is causing EG2 tests to spin
// on iOS14.
if (!base::ios::IsRunningOnIOS14OrLater()) {
if (!GetFirstResponder() && self.currentWebState) {
NewTabPageTabHelper* NTPHelper =
NewTabPageTabHelper::FromWebState(webState);
if (NTPHelper && NTPHelper->IsActive()) {
UIViewController* viewController =
_ntpCoordinatorsForWebStates[webState].viewController;
[viewController becomeFirstResponder];
} else {
[self.currentWebState->GetWebViewProxy() becomeFirstResponder];
}
}
}
}
......
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