Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: ios/chrome/browser/ui/toolbar/toolbar_egtest.mm

Issue 2959233002: [iOS] Add EG tests for the Keyboard accessory view. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/toolbar/toolbar_egtest.mm
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_egtest.mm b/ios/chrome/browser/ui/toolbar/toolbar_egtest.mm
index 96f6bd9fcf743fe05cc094d28c4a6ed330f16ba3..9322f86fb61803777df64cdbf51ab9f2c45ee030 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_egtest.mm
+++ b/ios/chrome/browser/ui/toolbar/toolbar_egtest.mm
@@ -471,4 +471,40 @@ void SelectNewTabPagePanel(NewTabPage::PanelIdentifier panel_type) {
SelectNewTabPagePanel(NewTabPage::kMostVisitedPanel);
}
+
+// Tests typing in the omnibox using the keyboard accessory view.
+- (void)testToolbarOmniboxKeyboardAccessoryView {
+ // Select the omnibox to get the keyboard up.
+ id<GREYMatcher> locationbarButton = grey_allOf(
+ grey_accessibilityLabel(l10n_util::GetNSString(IDS_OMNIBOX_EMPTY_HINT)),
+ grey_minimumVisiblePercent(0.2), nil);
+ [[EarlGrey selectElementWithMatcher:locationbarButton]
+ assertWithMatcher:grey_text(@"Search or type URL")];
+ [[EarlGrey selectElementWithMatcher:locationbarButton]
+ performAction:grey_tap()];
+
+ // Tap the "/" keyboard accessory button.
+ id<GREYMatcher> slashButtonMatcher = grey_allOf(
+ grey_accessibilityLabel(@"/"), grey_kindOfClass([UIButton class]), nil);
+
+ [[EarlGrey selectElementWithMatcher:slashButtonMatcher]
+ performAction:grey_tap()];
+
+ // Tap the ".com" keyboard accessory button.
+ id<GREYMatcher> dotComButtonMatcher =
+ grey_allOf(grey_accessibilityLabel(@".com"),
+ grey_kindOfClass([UIButton class]), nil);
+
+ [[EarlGrey selectElementWithMatcher:dotComButtonMatcher]
+ performAction:grey_tap()];
+
+ // Verify that the omnibox contains "/.com"
+ [[EarlGrey
+ selectElementWithMatcher:grey_allOf(grey_accessibilityLabel(@"/.com"),
+ grey_kindOfClass(
+ [OmniboxPopupMaterialRow class]),
+ nil)]
+ assertWithMatcher:grey_sufficientlyVisible()];
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698