| 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.
|
|
|