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/settings/settings_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 | « ios/chrome/browser/ui/reading_list/reading_list_egtest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/settings/settings_egtest.mm
diff --git a/ios/chrome/browser/ui/settings/settings_egtest.mm b/ios/chrome/browser/ui/settings/settings_egtest.mm
index 8f28c35173b0f3b49c0cf8c668d2cb4e3adf05c7..926c53dfb92395cc11dac6511a78019c5ce0651e 100644
--- a/ios/chrome/browser/ui/settings/settings_egtest.mm
+++ b/ios/chrome/browser/ui/settings/settings_egtest.mm
@@ -266,6 +266,11 @@ bool IsCertificateCleared() {
} // namespace
+// Expose the first responder.
+@interface UIWindow (FirstResponder)
+- (UIResponder*)firstResponder;
+@end
+
// Settings tests for Chrome.
@interface SettingsTestCase : ChromeTestCase
@end
@@ -954,4 +959,20 @@ bool IsCertificateCleared() {
[self closeSubSettingsMenu];
}
+// 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)testTabKeyIsANoOp {
+ // Open Settings.
+ [ChromeEarlGreyUI openToolsMenu];
+ [[EarlGrey selectElementWithMatcher:SettingsButton()]
+ 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]]);
+}
+
@end
« no previous file with comments | « ios/chrome/browser/ui/reading_list/reading_list_egtest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698