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

Unified Diff: ios/chrome/browser/ui/settings/accounts_collection_egtest.mm

Issue 2861243002: Use NavigationBarDoneButton() matcher in EarlGrey tests. (Closed)
Patch Set: Created 3 years, 7 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/settings/accounts_collection_egtest.mm
diff --git a/ios/chrome/browser/ui/settings/accounts_collection_egtest.mm b/ios/chrome/browser/ui/settings/accounts_collection_egtest.mm
index 73adca9ec4cc048e303c4f7e7d5278c3477e1742..b256e0e11c85c86b389c5a7340e862192953f6ab 100644
--- a/ios/chrome/browser/ui/settings/accounts_collection_egtest.mm
+++ b/ios/chrome/browser/ui/settings/accounts_collection_egtest.mm
@@ -25,6 +25,8 @@
#error "This file requires ARC support."
#endif
+using chrome_test_util::NavigationBarDoneButton;
+
namespace {
// Returns a fake identity.
@@ -121,8 +123,8 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
assertWithMatcher:grey_sufficientlyVisible()];
AssertAuthenticatedIdentityInActiveProfile(nil);
- // Close Settings.
- TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON);
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
+ performAction:grey_tap()];
}
// Tests that the Account Settings screen is correctly popped if the signed in
@@ -159,8 +161,8 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
assertWithMatcher:grey_sufficientlyVisible()];
AssertAuthenticatedIdentityInActiveProfile(nil);
- // Close Settings.
- TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON);
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
+ performAction:grey_tap()];
}
// Tests that the Account Settings screen is correctly reloaded when one of
@@ -193,8 +195,8 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
assertWithMatcher:grey_nil()];
AssertAuthenticatedIdentityInActiveProfile(identity1);
- // Close Settings.
- TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON);
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
+ performAction:grey_tap()];
}
// Tests that the Sync Settings screen is correctly reloaded when one of the
@@ -234,8 +236,8 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
assertWithMatcher:grey_nil()];
AssertAuthenticatedIdentityInActiveProfile(identity1);
- // Close Settings.
- TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON);
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
+ performAction:grey_tap()];
}
// Tests that the Account Settings screen is popped and the user signed out
@@ -263,8 +265,8 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
assertWithMatcher:grey_sufficientlyVisible()];
AssertAuthenticatedIdentityInActiveProfile(nil);
- // Close Settings.
- TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON);
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
+ performAction:grey_tap()];
}
// Tests that the user isn't signed out and the UI is correct when the
@@ -301,8 +303,8 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
assertWithMatcher:grey_sufficientlyVisible()];
AssertAuthenticatedIdentityInActiveProfile(identity);
- // Close Settings.
- TapButtonWithLabelId(IDS_IOS_NAVIGATION_BAR_DONE_BUTTON);
+ [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
+ performAction:grey_tap()];
}
@end

Powered by Google App Engine
This is Rietveld 408576698