Commit 7a934999 authored by Eric Aleshire's avatar Eric Aleshire Committed by Commit Bot

Remove CHROME_EG_ASSERT_NO_ERROR macro from callers of SignInEarlGreyUtils.

Bug: 963613
Change-Id: I05a043cd5d1788b53e38a5b9a51bc5da08ba7290
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1668312Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671484}
parent debd12e2
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#import "ios/chrome/test/earl_grey/chrome_actions.h" #import "ios/chrome/test/earl_grey/chrome_actions.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
#import "ios/chrome/test/earl_grey/chrome_error_util.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
...@@ -189,7 +188,7 @@ void SignOut() { ...@@ -189,7 +188,7 @@ void SignOut() {
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
} }
} // namespace } // namespace
......
...@@ -66,9 +66,7 @@ using chrome_test_util::UnifiedConsentAddAccountButton; ...@@ -66,9 +66,7 @@ using chrome_test_util::UnifiedConsentAddAccountButton;
[self confirmSigninConfirmationDialog]; [self confirmSigninConfirmationDialog];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
NSError* signedInError = [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity];
GREYAssertNil(signedInError, signedInError.localizedDescription);
} }
+ (void)selectIdentityWithEmail:(NSString*)userEmail { + (void)selectIdentityWithEmail:(NSString*)userEmail {
......
...@@ -28,12 +28,11 @@ ...@@ -28,12 +28,11 @@
// Returns a fake managed identity. // Returns a fake managed identity.
- (ChromeIdentity*)fakeManagedIdentity; - (ChromeIdentity*)fakeManagedIdentity;
// Checks that |identity| is actually signed in to the active profile. // Induces a GREYAssert if |identity| is not signed in to the active profile.
- (NSError*)checkSignedInWithIdentity:(ChromeIdentity*)identity - (void)checkSignedInWithIdentity:(ChromeIdentity*)identity;
WARN_UNUSED_RESULT;
// Checks that no identity is signed in. // Induces a GREYAssert if an identity is signed in.
- (NSError*)checkSignedOut WARN_UNUSED_RESULT; - (void)checkSignedOut;
@end @end
......
...@@ -37,7 +37,7 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(SigninEarlGreyUtilsAppInterface) ...@@ -37,7 +37,7 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(SigninEarlGreyUtilsAppInterface)
name:@"Fake Managed"]; name:@"Fake Managed"];
} }
- (NSError*)checkSignedInWithIdentity:(ChromeIdentity*)identity { - (void)checkSignedInWithIdentity:(ChromeIdentity*)identity {
BOOL identityIsNonNil = identity != nil; BOOL identityIsNonNil = identity != nil;
EG_TEST_HELPER_ASSERT_TRUE(identityIsNonNil, @"Need to give an identity"); EG_TEST_HELPER_ASSERT_TRUE(identityIsNonNil, @"Need to give an identity");
...@@ -55,11 +55,9 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(SigninEarlGreyUtilsAppInterface) ...@@ -55,11 +55,9 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(SigninEarlGreyUtilsAppInterface)
identity.gaiaID, primaryAccountGaiaID]; identity.gaiaID, primaryAccountGaiaID];
EG_TEST_HELPER_ASSERT_TRUE( EG_TEST_HELPER_ASSERT_TRUE(
[identity.gaiaID isEqualToString:primaryAccountGaiaID], errorStr); [identity.gaiaID isEqualToString:primaryAccountGaiaID], errorStr);
return nil;
} }
- (NSError*)checkSignedOut { - (void)checkSignedOut {
// Required to avoid any problem since the following test is not dependant to // Required to avoid any problem since the following test is not dependant to
// UI, and the previous action has to be totally finished before going through // UI, and the previous action has to be totally finished before going through
// the assert. // the assert.
...@@ -67,8 +65,6 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(SigninEarlGreyUtilsAppInterface) ...@@ -67,8 +65,6 @@ GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(SigninEarlGreyUtilsAppInterface)
EG_TEST_HELPER_ASSERT_TRUE([SignInEarlGreyUtilsAppInterface isSignedOut], EG_TEST_HELPER_ASSERT_TRUE([SignInEarlGreyUtilsAppInterface isSignedOut],
@"Unexpected signed in user"); @"Unexpected signed in user");
return nil;
} }
@end @end
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_chromium_strings.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/chrome/test/earl_grey/chrome_error_util.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
...@@ -218,8 +217,7 @@ id<GREYMatcher> UndoAccountConsistencyButton() { ...@@ -218,8 +217,7 @@ id<GREYMatcher> UndoAccountConsistencyButton() {
[[EarlGrey selectElementWithMatcher:AccountConsistencySetupSigninButton()] [[EarlGrey selectElementWithMatcher:AccountConsistencySetupSigninButton()]
performAction:grey_tap()]; performAction:grey_tap()];
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
// Undo the sign-in and dismiss the Sign In screen. // Undo the sign-in and dismiss the Sign In screen.
[[EarlGrey selectElementWithMatcher:UndoAccountConsistencyButton()] [[EarlGrey selectElementWithMatcher:UndoAccountConsistencyButton()]
...@@ -228,7 +226,7 @@ id<GREYMatcher> UndoAccountConsistencyButton() { ...@@ -228,7 +226,7 @@ id<GREYMatcher> UndoAccountConsistencyButton() {
performAction:grey_tap()]; performAction:grey_tap()];
// |identity| shouldn't be signed in. // |identity| shouldn't be signed in.
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
} }
// Signs in to an account and then taps the Advanced link to go to settings. // Signs in to an account and then taps the Advanced link to go to settings.
...@@ -247,13 +245,7 @@ id<GREYMatcher> UndoAccountConsistencyButton() { ...@@ -247,13 +245,7 @@ id<GREYMatcher> UndoAccountConsistencyButton() {
[[EarlGrey selectElementWithMatcher:AccountConsistencySetupSigninButton()] [[EarlGrey selectElementWithMatcher:AccountConsistencySetupSigninButton()]
performAction:grey_tap()]; performAction:grey_tap()];
NSError* signedInError = [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity];
// TODO(crbug.com/951600): Avoid asserting directly unless the test fails,
// due to timing issues.
if (signedInError != nil) {
GREYAssert(false, signedInError.localizedDescription);
}
} }
// Tap Settings link. // Tap Settings link.
...@@ -274,8 +266,7 @@ id<GREYMatcher> UndoAccountConsistencyButton() { ...@@ -274,8 +266,7 @@ id<GREYMatcher> UndoAccountConsistencyButton() {
performAction:grey_tap()]; performAction:grey_tap()];
} }
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
GREYAssertTrue(sync_service->HasFinishedInitialSetup(), GREYAssertTrue(sync_service->HasFinishedInitialSetup(),
@"Sync should have finished its original setup"); @"Sync should have finished its original setup");
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
#import "ios/chrome/test/earl_grey/chrome_error_util.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
...@@ -82,7 +81,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) { ...@@ -82,7 +81,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) {
[[EarlGrey selectElementWithMatcher:PrimarySignInButton()] [[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -108,7 +107,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) { ...@@ -108,7 +107,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) {
[[EarlGrey selectElementWithMatcher:PrimarySignInButton()] [[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -141,8 +140,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) { ...@@ -141,8 +140,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) {
grey_accessibilityLabel(identity2.userEmail), grey_accessibilityLabel(identity2.userEmail),
grey_sufficientlyVisible(), nil)] grey_sufficientlyVisible(), nil)]
assertWithMatcher:grey_nil()]; assertWithMatcher:grey_nil()];
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity1];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity1]);
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -188,8 +186,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) { ...@@ -188,8 +186,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) {
grey_accessibilityLabel(identity2.userEmail), grey_accessibilityLabel(identity2.userEmail),
grey_sufficientlyVisible(), nil)] grey_sufficientlyVisible(), nil)]
assertWithMatcher:grey_nil()]; assertWithMatcher:grey_nil()];
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity1];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity1]);
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -215,7 +212,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) { ...@@ -215,7 +212,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) {
// Check that the user is signed out and the Main Settings screen is shown. // Check that the user is signed out and the Main Settings screen is shown.
[[EarlGrey selectElementWithMatcher:PrimarySignInButton()] [[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -244,8 +241,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) { ...@@ -244,8 +241,7 @@ id<GREYMatcher> ButtonWithIdentity(ChromeIdentity* identity) {
[[EarlGrey selectElementWithMatcher:chrome_test_util:: [[EarlGrey selectElementWithMatcher:chrome_test_util::
SettingsAccountsCollectionView()] SettingsAccountsCollectionView()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
#import "ios/chrome/test/earl_grey/chrome_error_util.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
...@@ -74,8 +73,7 @@ using chrome_test_util::ButtonWithAccessibilityLabelId; ...@@ -74,8 +73,7 @@ using chrome_test_util::ButtonWithAccessibilityLabelId;
[SigninEarlGreyUI confirmSigninConfirmationDialog]; [SigninEarlGreyUI confirmSigninConfirmationDialog];
// User signed in. // User signed in.
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
[SigninEarlGreyUI checkSigninPromoNotVisible]; [SigninEarlGreyUI checkSigninPromoNotVisible];
[[EarlGrey selectElementWithMatcher:SettingsAccountButton()] [[EarlGrey selectElementWithMatcher:SettingsAccountButton()]
assertWithMatcher:grey_interactable()]; assertWithMatcher:grey_interactable()];
...@@ -95,8 +93,7 @@ using chrome_test_util::ButtonWithAccessibilityLabelId; ...@@ -95,8 +93,7 @@ using chrome_test_util::ButtonWithAccessibilityLabelId;
[SigninEarlGreyUI confirmSigninConfirmationDialog]; [SigninEarlGreyUI confirmSigninConfirmationDialog];
// User signed in. // User signed in.
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
[SigninEarlGreyUI checkSigninPromoNotVisible]; [SigninEarlGreyUI checkSigninPromoNotVisible];
[[EarlGrey selectElementWithMatcher:SettingsAccountButton()] [[EarlGrey selectElementWithMatcher:SettingsAccountButton()]
assertWithMatcher:grey_interactable()]; assertWithMatcher:grey_interactable()];
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
#import "ios/chrome/test/earl_grey/chrome_error_util.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
...@@ -91,8 +90,7 @@ void TapOnPrimarySignInButtonInRecentTabs() { ...@@ -91,8 +90,7 @@ void TapOnPrimarySignInButtonInRecentTabs() {
[SigninEarlGreyUI signinWithIdentity:identity]; [SigninEarlGreyUI signinWithIdentity:identity];
// Check |identity| is signed-in. // Check |identity| is signed-in.
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
} }
// Tests that signing out from the Settings works correctly. // Tests that signing out from the Settings works correctly.
...@@ -123,7 +121,7 @@ void TapOnPrimarySignInButtonInRecentTabs() { ...@@ -123,7 +121,7 @@ void TapOnPrimarySignInButtonInRecentTabs() {
performAction:grey_tap()]; performAction:grey_tap()];
// Check that there is no signed in user. // Check that there is no signed in user.
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
} }
// Tests that signing out of a managed account from the Settings works // Tests that signing out of a managed account from the Settings works
...@@ -146,8 +144,7 @@ void TapOnPrimarySignInButtonInRecentTabs() { ...@@ -146,8 +144,7 @@ void TapOnPrimarySignInButtonInRecentTabs() {
SetEarlGreySynchronizationEnabled(YES); SetEarlGreySynchronizationEnabled(YES);
[SigninEarlGreyUI confirmSigninConfirmationDialog]; [SigninEarlGreyUI confirmSigninConfirmationDialog];
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
// Go to Accounts Settings and tap the sign out button. // Go to Accounts Settings and tap the sign out button.
[[EarlGrey selectElementWithMatcher:chrome_test_util::SettingsAccountButton()] [[EarlGrey selectElementWithMatcher:chrome_test_util::SettingsAccountButton()]
...@@ -167,7 +164,7 @@ void TapOnPrimarySignInButtonInRecentTabs() { ...@@ -167,7 +164,7 @@ void TapOnPrimarySignInButtonInRecentTabs() {
performAction:grey_tap()]; performAction:grey_tap()];
// Check that there is no signed in user. // Check that there is no signed in user.
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
} }
// Tests that signing in, tapping the Settings link on the confirmation screen // Tests that signing in, tapping the Settings link on the confirmation screen
...@@ -199,8 +196,7 @@ void TapOnPrimarySignInButtonInRecentTabs() { ...@@ -199,8 +196,7 @@ void TapOnPrimarySignInButtonInRecentTabs() {
IDS_IOS_SETTINGS_TITLE); IDS_IOS_SETTINGS_TITLE);
[[EarlGrey selectElementWithMatcher:settings_matcher] [[EarlGrey selectElementWithMatcher:settings_matcher]
assertWithMatcher:grey_notVisible()]; assertWithMatcher:grey_notVisible()];
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
} }
// Opens the sign in screen and then cancel it by opening a new tab. Ensures // Opens the sign in screen and then cancel it by opening a new tab. Ensures
...@@ -269,7 +265,7 @@ void TapOnPrimarySignInButtonInRecentTabs() { ...@@ -269,7 +265,7 @@ void TapOnPrimarySignInButtonInRecentTabs() {
onElementWithMatcher:chrome_test_util::SettingsAccountsCollectionView()] onElementWithMatcher:chrome_test_util::SettingsAccountsCollectionView()]
performAction:grey_tap()]; performAction:grey_tap()];
TapButtonWithLabelId(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE); TapButtonWithLabelId(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE);
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
// Sign in with |identity1|. // Sign in with |identity1|.
[[EarlGrey selectElementWithMatcher:SecondarySignInButton()] [[EarlGrey selectElementWithMatcher:SecondarySignInButton()]
...@@ -300,7 +296,7 @@ void TapOnPrimarySignInButtonInRecentTabs() { ...@@ -300,7 +296,7 @@ void TapOnPrimarySignInButtonInRecentTabs() {
TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON); TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SKIP_BUTTON);
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
} }
// Opens the sign in screen from the bookmarks and then cancel it by tapping on // Opens the sign in screen from the bookmarks and then cancel it by tapping on
...@@ -468,11 +464,10 @@ void TapOnPrimarySignInButtonInRecentTabs() { ...@@ -468,11 +464,10 @@ void TapOnPrimarySignInButtonInRecentTabs() {
GREYAssertEqual(expectedString, webState->GetVisibleURL(), @"url not loaded"); GREYAssertEqual(expectedString, webState->GetVisibleURL(), @"url not loaded");
if (tapSettingsLink) { if (tapSettingsLink) {
// Should be signed in. // Should be signed in.
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity]);
} else { } else {
// Should be not signed in. // Should be not signed in.
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
} }
} }
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h" #import "ios/chrome/test/earl_grey/chrome_earl_grey_ui.h"
#import "ios/chrome/test/earl_grey/chrome_error_util.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h" #import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
...@@ -62,7 +61,7 @@ void SignOutFromSettings() { ...@@ -62,7 +61,7 @@ void SignOutFromSettings() {
onElementWithMatcher:chrome_test_util::SettingsAccountsCollectionView()] onElementWithMatcher:chrome_test_util::SettingsAccountsCollectionView()]
performAction:grey_tap()]; performAction:grey_tap()];
TapButtonWithLabelId(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE); TapButtonWithLabelId(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE);
CHROME_EG_ASSERT_NO_ERROR([SigninEarlGreyUtils checkSignedOut]); [SigninEarlGreyUtils checkSignedOut];
} }
} // namespace } // namespace
...@@ -160,8 +159,7 @@ void SignOutFromSettings() { ...@@ -160,8 +159,7 @@ void SignOutFromSettings() {
performAction:grey_tap()]; performAction:grey_tap()];
// Check the signed-in user did change. // Check the signed-in user did change.
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity2];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity2]);
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -205,8 +203,7 @@ void SignOutFromSettings() { ...@@ -205,8 +203,7 @@ void SignOutFromSettings() {
performAction:grey_tap()]; performAction:grey_tap()];
// Check the signed-in user did change. // Check the signed-in user did change.
CHROME_EG_ASSERT_NO_ERROR( [SigninEarlGreyUtils checkSignedInWithIdentity:identity2];
[SigninEarlGreyUtils checkSignedInWithIdentity:identity2]);
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment