Commit 99473df8 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Dismiss keyboard when navigating to chrome://flags in test.

On iOS 13 chrome://flags presents the keyboard which does not allow
tapping on back button.

Bug: 977707
Change-Id: Ia0da9e063b894da4fbfccfb12d7d839774c3b230
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1666731
Commit-Queue: Eugene But <eugenebut@chromium.org>
Auto-Submit: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#673082}
parent 78c6dedc
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#import <EarlGrey/EarlGrey.h> #import <EarlGrey/EarlGrey.h>
#import <EarlGrey/GREYKeyboard.h>
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
...@@ -141,6 +142,13 @@ id<GREYMatcher> WaitForOmniboxText(std::string text) { ...@@ -141,6 +142,13 @@ id<GREYMatcher> WaitForOmniboxText(std::string text) {
// Navigate to the second URL chrome://flags. // Navigate to the second URL chrome://flags.
LoadWebUIUrl(kChromeUIFlagsHost); LoadWebUIUrl(kChromeUIFlagsHost);
// Navigating to chrome://flags should trigger the keyboard, but pre-iOS13
// this is broken.
if (@available(iOS 13.0, *)) {
GREYAssertTrue([GREYKeyboard isKeyboardShown], @"Keyboard should be Shown");
[EarlGrey dismissKeyboardWithError:nil];
}
// Tap the back button in the toolbar and verify that the resulting page's URL // Tap the back button in the toolbar and verify that the resulting page's URL
// corresponds to the first URL chrome://version that was loaded. // corresponds to the first URL chrome://version that was loaded.
[[EarlGrey selectElementWithMatcher:BackButton()] performAction:grey_tap()]; [[EarlGrey selectElementWithMatcher:BackButton()] performAction:grey_tap()];
......
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