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

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm

Issue 2714933002: Add tests against pressing tab when a view controller is presented
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | ios/chrome/browser/ui/history/history_ui_egtest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm
diff --git a/ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm b/ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm
index 05a248d039d22119c9b3f60d749870e486afb0de..3bc9c1ab304229dd565f3ac82664e6211d578c71 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmarks_egtest.mm
@@ -129,6 +129,11 @@ id<GREYMatcher> ActionSheet(Action action) {
} // namespace
+// Expose the first responder.
+@interface UIWindow (FirstResponder)
+- (UIResponder*)firstResponder;
+@end
+
// Bookmark integration tests for Chrome.
@interface BookmarksTestCase : ChromeTestCase
@end
@@ -1265,6 +1270,40 @@ id<GREYMatcher> ActionSheet(Action action) {
performAction:grey_tap()];
}
+// Tests that hitting the tab key doesn't trigger the omnibox in the background.
+// Testing against regressions of the fix for crbug.com/676993.
+- (void)testTabKeyIsANoOpWhenEditing {
+ const GURL bookmarkURL = web::test::HttpServer::MakeUrl(
+ "http://ios/testing/data/http_server_files/destination.html");
+ NSString* bookmarkTitle = @"Some Bookmark";
+
+ // Load a bookmark into the bookmark model.
+ [BookmarksTestCase addBookmark:bookmarkURL withTitle:bookmarkTitle];
+
+ // Open the bookmark editor.
+ NSString* const kStarLitLabel =
+ !IsCompact() ? l10n_util::GetNSString(IDS_TOOLTIP_STAR)
+ : l10n_util::GetNSString(IDS_IOS_BOOKMARK_EDIT_SCREEN_TITLE);
+ if (IsCompact()) {
+ [ChromeEarlGreyUI openToolsMenu];
+ }
+ [[EarlGrey selectElementWithMatcher:grey_accessibilityLabel(kStarLitLabel)]
+ performAction:grey_tap()];
+
+ // Hit the tab key.
+ // TODO(crbug.com/695876): Simulate a tab key press with EalrGrey.
+
+ // Verify that the omnibox is not focused.
+ GREYAssertFalse([[[[UIApplication sharedApplication] keyWindow]
+ firstResponder] isKindOfClass:[UITextField class]]);
+}
+
+// Tests that hitting the tab key doesn't trigger the omnibox in the background.
+// Testing against regressions of the fix for crbug.com/676993.
+- (void)testTabKeyIsANoOpWhenSignInPromoIsOpen {
+ TODO
+}
+
#pragma mark Helper Methods
// Navigates to the bookmark manager UI.
« no previous file with comments | « no previous file | ios/chrome/browser/ui/history/history_ui_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698