Commit 3eed7658 authored by Nohemi Fernandez's avatar Nohemi Fernandez Committed by Commit Bot

[iOS] Update SigninEarlGrey testing class names.

Current sign-in test class names are inconsistent with existing code
across Chrome iOS. Update these before proposing new APIs.

Bug: 1103274
Change-Id: I5d8940d44f21ec047d6399087af44466231903c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2330010
Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#793584}
parent 3c4f1275
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include "components/metrics/demographic_metrics_provider.h" #include "components/metrics/demographic_metrics_provider.h"
#include "components/ukm/ukm_service.h" #include "components/ukm/ukm_service.h"
#import "ios/chrome/browser/metrics/metrics_app_interface.h" #import "ios/chrome/browser/metrics/metrics_app_interface.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.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_test_case.h" #import "ios/chrome/test/earl_grey/chrome_test_case.h"
#import "ios/testing/earl_grey/app_launch_configuration.h" #import "ios/testing/earl_grey/app_launch_configuration.h"
...@@ -132,7 +132,7 @@ const metrics::UserDemographicsProto::Gender kTestGender = ...@@ -132,7 +132,7 @@ const metrics::UserDemographicsProto::Gender kTestGender =
// anonymized data collection is turned on as part of the flow to Sign in to // anonymized data collection is turned on as part of the flow to Sign in to
// Chrome and Turn on sync. This matches the main user flow that enables // Chrome and Turn on sync. This matches the main user flow that enables
// UKM. // UKM.
[SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGreyUtils fakeIdentity1]]; [SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGrey fakeIdentity1]];
[ChromeEarlGrey waitForSyncInitialized:YES [ChromeEarlGrey waitForSyncInitialized:YES
syncTimeout:syncher::kSyncUKMOperationsTimeout]; syncTimeout:syncher::kSyncUKMOperationsTimeout];
} }
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include "base/ios/ios_util.h" #include "base/ios/ios_util.h"
#include "base/macros.h" #include "base/macros.h"
#import "ios/chrome/browser/metrics/metrics_app_interface.h" #import "ios/chrome/browser/metrics/metrics_app_interface.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils_app_interface.h"
#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"
...@@ -63,7 +63,7 @@ using chrome_test_util::SettingsDoneButton; ...@@ -63,7 +63,7 @@ using chrome_test_util::SettingsDoneButton;
// Note: URL-keyed anonymized data collection is turned on as part of the // Note: URL-keyed anonymized data collection is turned on as part of the
// flow to Sign in to Chrome and Turn sync on. This matches the main user // flow to Sign in to Chrome and Turn sync on. This matches the main user
// flow that enables UKM. // flow that enables UKM.
[SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGreyUtils fakeIdentity1]]; [SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGrey fakeIdentity1]];
[ChromeEarlGrey waitForSyncInitialized:YES [ChromeEarlGrey waitForSyncInitialized:YES
syncTimeout:syncher::kSyncUKMOperationsTimeout]; syncTimeout:syncher::kSyncUKMOperationsTimeout];
...@@ -93,8 +93,8 @@ using chrome_test_util::SettingsDoneButton; ...@@ -93,8 +93,8 @@ using chrome_test_util::SettingsDoneButton;
// Note: URL-keyed anonymized data collection is turned off as part of the // Note: URL-keyed anonymized data collection is turned off as part of the
// flow to Sign out of Chrome and Turn sync off. This matches the main user // flow to Sign out of Chrome and Turn sync off. This matches the main user
// flow that disables UKM. // flow that disables UKM.
if (![SigninEarlGreyUtilsAppInterface isSignedOut]) { if (![SigninEarlGreyAppInterface isSignedOut]) {
[SigninEarlGreyUtilsAppInterface signOut]; [SigninEarlGreyAppInterface signOut];
} }
[ChromeEarlGrey waitForSyncInitialized:NO [ChromeEarlGrey waitForSyncInitialized:NO
...@@ -274,7 +274,7 @@ using chrome_test_util::SettingsDoneButton; ...@@ -274,7 +274,7 @@ using chrome_test_util::SettingsDoneButton;
// Corresponds to ConsentAddedButNoSyncCheck in //chrome/browser/metrics/ // Corresponds to ConsentAddedButNoSyncCheck in //chrome/browser/metrics/
// ukm_browsertest.cc. // ukm_browsertest.cc.
- (void)testConsentAddedButNoSync { - (void)testConsentAddedButNoSync {
[SigninEarlGreyUtilsAppInterface signOut]; [SigninEarlGreyAppInterface signOut];
[MetricsAppInterface setMetricsAndCrashReportingForTesting:NO]; [MetricsAppInterface setMetricsAndCrashReportingForTesting:NO];
GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO], GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO],
@"Failed to assert that UKM was not enabled."); @"Failed to assert that UKM was not enabled.");
...@@ -283,7 +283,7 @@ using chrome_test_util::SettingsDoneButton; ...@@ -283,7 +283,7 @@ using chrome_test_util::SettingsDoneButton;
GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO], GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO],
@"Failed to assert that UKM was not enabled."); @"Failed to assert that UKM was not enabled.");
[SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGreyUtils fakeIdentity1]]; [SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGrey fakeIdentity1]];
GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:YES], GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:YES],
@"Failed to assert that UKM was enabled."); @"Failed to assert that UKM was enabled.");
} }
...@@ -347,7 +347,7 @@ using chrome_test_util::SettingsDoneButton; ...@@ -347,7 +347,7 @@ using chrome_test_util::SettingsDoneButton;
#endif #endif
const uint64_t clientID1 = [MetricsAppInterface UKMClientID]; const uint64_t clientID1 = [MetricsAppInterface UKMClientID];
[SigninEarlGreyUtilsAppInterface signOut]; [SigninEarlGreyAppInterface signOut];
GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO], GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:NO],
@"Failed to assert that UKM was not enabled."); @"Failed to assert that UKM was not enabled.");
...@@ -356,7 +356,7 @@ using chrome_test_util::SettingsDoneButton; ...@@ -356,7 +356,7 @@ using chrome_test_util::SettingsDoneButton;
@"Client ID was not reset."); @"Client ID was not reset.");
const uint64_t clientID2 = [MetricsAppInterface UKMClientID]; const uint64_t clientID2 = [MetricsAppInterface UKMClientID];
[SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGreyUtils fakeIdentity1]]; [SigninEarlGreyUI signinWithFakeIdentity:[SigninEarlGrey fakeIdentity1]];
GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:YES], GREYAssert([MetricsAppInterface checkUKMRecordingEnabled:YES],
@"Failed to assert that UKM was enabled."); @"Failed to assert that UKM was enabled.");
......
...@@ -144,8 +144,8 @@ source_set("eg_app_support+eg2") { ...@@ -144,8 +144,8 @@ source_set("eg_app_support+eg2") {
] ]
testonly = true testonly = true
sources = [ sources = [
"signin_earlgrey_utils_app_interface.h", "signin_earl_grey_app_interface.h",
"signin_earlgrey_utils_app_interface.mm", "signin_earl_grey_app_interface.mm",
] ]
deps = [ deps = [
":authentication", ":authentication",
...@@ -177,12 +177,12 @@ source_set("eg_test_support+eg2") { ...@@ -177,12 +177,12 @@ source_set("eg_test_support+eg2") {
] ]
testonly = true testonly = true
sources = [ sources = [
"signin_earl_grey.h",
"signin_earl_grey.mm",
"signin_earl_grey_app_interface.h",
"signin_earl_grey_app_interface_stub.mm",
"signin_earl_grey_ui.h", "signin_earl_grey_ui.h",
"signin_earl_grey_ui.mm", "signin_earl_grey_ui.mm",
"signin_earlgrey_utils.h",
"signin_earlgrey_utils.mm",
"signin_earlgrey_utils_app_interface.h",
"signin_earlgrey_utils_app_interface_stub.mm",
] ]
deps = [ deps = [
"//base", "//base",
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARLGREY_UTILS_H_ #ifndef IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARL_GREY_H_
#define IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARLGREY_UTILS_H_ #define IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARL_GREY_H_
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
@protocol GREYMatcher; @protocol GREYMatcher;
@class FakeChromeIdentity; @class FakeChromeIdentity;
#define SigninEarlGreyUtils \ #define SigninEarlGrey \
[SigninEarlGreyUtilsImpl invokedFromFile:@"" __FILE__ lineNumber:__LINE__] [SigninEarlGreyImpl invokedFromFile:@"" __FILE__ lineNumber:__LINE__]
// Methods used for the EarlGrey tests. // Methods used for the EarlGrey tests.
// TODO(crbug.com/974833): Consider moving these into ChromeEarlGrey. // TODO(crbug.com/974833): Consider moving these into ChromeEarlGrey.
@interface SigninEarlGreyUtilsImpl : BaseEGTestHelperImpl @interface SigninEarlGreyImpl : BaseEGTestHelperImpl
// Returns a fake identity. // Returns a fake identity.
- (FakeChromeIdentity*)fakeIdentity1; - (FakeChromeIdentity*)fakeIdentity1;
...@@ -51,4 +51,4 @@ ...@@ -51,4 +51,4 @@
@end @end
#endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARLGREY_UTILS_H_ #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARL_GREY_H_
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils_app_interface.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.h"
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity.h"
#import "ios/testing/earl_grey/earl_grey_test.h" #import "ios/testing/earl_grey/earl_grey_test.h"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
@implementation SigninEarlGreyUtilsImpl @implementation SigninEarlGreyImpl
- (FakeChromeIdentity*)fakeIdentity1 { - (FakeChromeIdentity*)fakeIdentity1 {
return [FakeChromeIdentity identityWithEmail:@"foo1@gmail.com" return [FakeChromeIdentity identityWithEmail:@"foo1@gmail.com"
...@@ -34,11 +34,11 @@ ...@@ -34,11 +34,11 @@
} }
- (void)addFakeIdentity:(FakeChromeIdentity*)fakeIdentity { - (void)addFakeIdentity:(FakeChromeIdentity*)fakeIdentity {
[SigninEarlGreyUtilsAppInterface addFakeIdentity:fakeIdentity]; [SigninEarlGreyAppInterface addFakeIdentity:fakeIdentity];
} }
- (void)forgetFakeIdentity:(FakeChromeIdentity*)fakeIdentity { - (void)forgetFakeIdentity:(FakeChromeIdentity*)fakeIdentity {
[SigninEarlGreyUtilsAppInterface forgetFakeIdentity:fakeIdentity]; [SigninEarlGreyAppInterface forgetFakeIdentity:fakeIdentity];
} }
- (void)checkSignedInWithFakeIdentity:(FakeChromeIdentity*)fakeIdentity { - (void)checkSignedInWithFakeIdentity:(FakeChromeIdentity*)fakeIdentity {
...@@ -52,14 +52,14 @@ ...@@ -52,14 +52,14 @@
base::test::ios::kWaitForActionTimeout, base::test::ios::kWaitForActionTimeout,
^bool { ^bool {
NSString* primaryAccountGaiaID = NSString* primaryAccountGaiaID =
[SigninEarlGreyUtilsAppInterface primaryAccountGaiaID]; [SigninEarlGreyAppInterface primaryAccountGaiaID];
return primaryAccountGaiaID.length > 0; return primaryAccountGaiaID.length > 0;
}), }),
@"Sign in did not complete."); @"Sign in did not complete.");
GREYWaitForAppToIdle(@"App failed to idle"); GREYWaitForAppToIdle(@"App failed to idle");
NSString* primaryAccountGaiaID = NSString* primaryAccountGaiaID =
[SigninEarlGreyUtilsAppInterface primaryAccountGaiaID]; [SigninEarlGreyAppInterface primaryAccountGaiaID];
NSString* errorStr = [NSString NSString* errorStr = [NSString
stringWithFormat:@"Unexpected Gaia ID of the signed in user [expected = " stringWithFormat:@"Unexpected Gaia ID of the signed in user [expected = "
...@@ -75,12 +75,12 @@ ...@@ -75,12 +75,12 @@
// the assert. // the assert.
GREYWaitForAppToIdle(@"App failed to idle"); GREYWaitForAppToIdle(@"App failed to idle");
EG_TEST_HELPER_ASSERT_TRUE([SigninEarlGreyUtilsAppInterface isSignedOut], EG_TEST_HELPER_ASSERT_TRUE([SigninEarlGreyAppInterface isSignedOut],
@"Unexpected signed in user"); @"Unexpected signed in user");
} }
- (void)removeFakeIdentity:(FakeChromeIdentity*)fakeIdentity { - (void)removeFakeIdentity:(FakeChromeIdentity*)fakeIdentity {
[SigninEarlGreyUtilsAppInterface removeFakeIdentity:fakeIdentity]; [SigninEarlGreyAppInterface removeFakeIdentity:fakeIdentity];
} }
- (void)waitForMatcher:(id<GREYMatcher>)matcher { - (void)waitForMatcher:(id<GREYMatcher>)matcher {
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARLGREY_UTILS_APP_INTERFACE_H_ #ifndef IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARL_GREY_APP_INTERFACE_H_
#define IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARLGREY_UTILS_APP_INTERFACE_H_ #define IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARL_GREY_APP_INTERFACE_H_
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class FakeChromeIdentity; @class FakeChromeIdentity;
@protocol GREYMatcher; @protocol GREYMatcher;
// SigninEarlGreyUtilsAppInterface contains the app-side implementation for // SigninEarlGreyAppInterface contains the app-side implementation for
// helpers that primarily work via direct model access. These helpers are // helpers that primarily work via direct model access. These helpers are
// compiled into the app binary and can be called from either app or test code. // compiled into the app binary and can be called from either app or test code.
@interface SigninEarlGreyUtilsAppInterface : NSObject @interface SigninEarlGreyAppInterface : NSObject
// Returns a fake identity. // Returns a fake identity.
+ (FakeChromeIdentity*)fakeIdentity1; + (FakeChromeIdentity*)fakeIdentity1;
...@@ -48,4 +48,4 @@ ...@@ -48,4 +48,4 @@
@end @end
#endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARLGREY_UTILS_APP_INTERFACE_H_ #endif // IOS_CHROME_BROWSER_UI_AUTHENTICATION_SIGNIN_EARL_GREY_APP_INTERFACE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils_app_interface.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/browser/bookmark_model.h"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
@implementation SigninEarlGreyUtilsAppInterface @implementation SigninEarlGreyAppInterface
+ (FakeChromeIdentity*)fakeIdentity1 { + (FakeChromeIdentity*)fakeIdentity1 {
return [FakeChromeIdentity identityWithEmail:@"foo1@gmail.com" return [FakeChromeIdentity identityWithEmail:@"foo1@gmail.com"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils_app_interface.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.h"
#import "ios/third_party/earl_grey2/src/CommonLib/DistantObject/GREYTestApplicationDistantObject.h" #import "ios/third_party/earl_grey2/src/CommonLib/DistantObject/GREYTestApplicationDistantObject.h"
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(SigninEarlGreyUtilsAppInterface) GREY_STUB_CLASS_IN_APP_MAIN_QUEUE(SigninEarlGreyAppInterface)
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#import "ios/chrome/browser/ui/authentication/cells/signin_promo_view_constants.h" #import "ios/chrome/browser/ui/authentication/cells/signin_promo_view_constants.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils_app_interface.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_app_interface.h"
#import "ios/chrome/browser/ui/authentication/unified_consent/unified_consent_constants.h" #import "ios/chrome/browser/ui/authentication/unified_consent/unified_consent_constants.h"
#import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h" #import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
...@@ -38,7 +38,7 @@ using chrome_test_util::SignOutAccountsButton; ...@@ -38,7 +38,7 @@ using chrome_test_util::SignOutAccountsButton;
+ (void)signinWithFakeIdentity:(FakeChromeIdentity*)fakeIdentity + (void)signinWithFakeIdentity:(FakeChromeIdentity*)fakeIdentity
isManagedAccount:(BOOL)isManagedAccount { isManagedAccount:(BOOL)isManagedAccount {
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI [ChromeEarlGreyUI
tapSettingsMenuButton:chrome_test_util::SecondarySignInButton()]; tapSettingsMenuButton:chrome_test_util::SecondarySignInButton()];
...@@ -49,13 +49,13 @@ using chrome_test_util::SignOutAccountsButton; ...@@ -49,13 +49,13 @@ using chrome_test_util::SignOutAccountsButton;
} }
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[SigninEarlGreyUtils checkSignedInWithFakeIdentity:fakeIdentity]; [SigninEarlGrey checkSignedInWithFakeIdentity:fakeIdentity];
} }
+ (void)selectIdentityWithEmail:(NSString*)userEmail { + (void)selectIdentityWithEmail:(NSString*)userEmail {
// Assumes that the identity chooser is visible. // Assumes that the identity chooser is visible.
[[EarlGrey [[EarlGrey
selectElementWithMatcher:[SigninEarlGreyUtilsAppInterface selectElementWithMatcher:[SigninEarlGreyAppInterface
identityCellMatcherForEmail:userEmail]] identityCellMatcherForEmail:userEmail]]
performAction:grey_tap()]; performAction:grey_tap()];
} }
...@@ -74,7 +74,7 @@ using chrome_test_util::SignOutAccountsButton; ...@@ -74,7 +74,7 @@ using chrome_test_util::SignOutAccountsButton;
ScopedSynchronizationDisabler disabler; ScopedSynchronizationDisabler disabler;
id<GREYMatcher> acceptButton = [ChromeMatchersAppInterface id<GREYMatcher> acceptButton = [ChromeMatchersAppInterface
buttonWithAccessibilityLabelID:IDS_IOS_MANAGED_SIGNIN_ACCEPT_BUTTON]; buttonWithAccessibilityLabelID:IDS_IOS_MANAGED_SIGNIN_ACCEPT_BUTTON];
[SigninEarlGreyUtils waitForMatcher:acceptButton]; [SigninEarlGrey waitForMatcher:acceptButton];
[[EarlGrey selectElementWithMatcher:acceptButton] performAction:grey_tap()]; [[EarlGrey selectElementWithMatcher:acceptButton] performAction:grey_tap()];
} }
...@@ -224,7 +224,7 @@ using chrome_test_util::SignOutAccountsButton; ...@@ -224,7 +224,7 @@ using chrome_test_util::SignOutAccountsButton;
[ChromeEarlGreyUI waitForAppToIdle]; [ChromeEarlGreyUI waitForAppToIdle];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[SigninEarlGreyUtils checkSignedOut]; [SigninEarlGrey checkSignedOut];
} }
+ (void)tapRemoveAccountFromDeviceWithFakeIdentity: + (void)tapRemoveAccountFromDeviceWithFakeIdentity:
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
#include "base/ios/ios_util.h" #include "base/ios/ios_util.h"
#import "ios/chrome/browser/ui/authentication/signin/signin_constants.h" #import "ios/chrome/browser/ui/authentication/signin/signin_constants.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_ui_constants.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_ui_constants.h"
...@@ -150,7 +150,7 @@ using chrome_test_util::SecondarySignInButton; ...@@ -150,7 +150,7 @@ using chrome_test_util::SecondarySignInButton;
[BookmarkEarlGreyUI openBookmarks]; [BookmarkEarlGreyUI openBookmarks];
// Set up a fake identity. // Set up a fake identity.
[SigninEarlGreyUtils addFakeIdentity:[SigninEarlGreyUtils fakeIdentity1]]; [SigninEarlGrey addFakeIdentity:[SigninEarlGrey fakeIdentity1]];
// Check that promo is visible. // Check that promo is visible.
[BookmarkEarlGrey verifyPromoAlreadySeen:NO]; [BookmarkEarlGrey verifyPromoAlreadySeen:NO];
...@@ -182,8 +182,8 @@ using chrome_test_util::SecondarySignInButton; ...@@ -182,8 +182,8 @@ using chrome_test_util::SecondarySignInButton;
[BookmarkEarlGrey setupStandardBookmarks]; [BookmarkEarlGrey setupStandardBookmarks];
[BookmarkEarlGreyUI openBookmarks]; [BookmarkEarlGreyUI openBookmarks];
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
// Check that sign-in promo view are visible. // Check that sign-in promo view are visible.
[BookmarkEarlGrey verifyPromoAlreadySeen:NO]; [BookmarkEarlGrey verifyPromoAlreadySeen:NO];
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#import "base/test/ios/wait_util.h" #import "base/test/ios/wait_util.h"
#import "ios/chrome/browser/ui/authentication/signin/signin_constants.h" #import "ios/chrome/browser/ui/authentication/signin/signin_constants.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/browser/ui/first_run/first_run_app_interface.h" #import "ios/chrome/browser/ui/first_run/first_run_app_interface.h"
#import "ios/chrome/browser/ui/first_run/first_run_constants.h" #import "ios/chrome/browser/ui/first_run/first_run_constants.h"
#include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_chromium_strings.h"
...@@ -122,8 +122,8 @@ id<GREYMatcher> SkipSigninButton() { ...@@ -122,8 +122,8 @@ id<GREYMatcher> SkipSigninButton() {
// 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.
- (void)testSignInAndTapSettingsLink { - (void)testSignInAndTapSettingsLink {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
// Launch First Run and accept tems of services. // Launch First Run and accept tems of services.
[FirstRunAppInterface showFirstRunUI]; [FirstRunAppInterface showFirstRunUI];
...@@ -141,7 +141,7 @@ id<GREYMatcher> SkipSigninButton() { ...@@ -141,7 +141,7 @@ id<GREYMatcher> SkipSigninButton() {
[[EarlGrey selectElementWithMatcher:SyncSettingsConfirmButton()] [[EarlGrey selectElementWithMatcher:SyncSettingsConfirmButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[SigninEarlGreyUtils checkSignedInWithFakeIdentity:fakeIdentity]; [SigninEarlGrey checkSignedInWithFakeIdentity:fakeIdentity];
GREYAssertTrue([FirstRunAppInterface isSyncFirstSetupComplete], GREYAssertTrue([FirstRunAppInterface isSyncFirstSetupComplete],
@"Sync should have finished its original setup"); @"Sync should have finished its original setup");
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include "base/ios/ios_util.h" #include "base/ios/ios_util.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/authentication/cells/signin_promo_view_constants.h" #import "ios/chrome/browser/ui/authentication/cells/signin_promo_view_constants.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/browser/ui/history/history_ui_constants.h" #import "ios/chrome/browser/ui/history/history_ui_constants.h"
#import "ios/chrome/browser/ui/list_model/list_model.h" #import "ios/chrome/browser/ui/list_model/list_model.h"
#import "ios/chrome/browser/ui/recent_tabs/recent_tabs_constants.h" #import "ios/chrome/browser/ui/recent_tabs/recent_tabs_constants.h"
...@@ -162,13 +162,13 @@ id<GREYMatcher> TitleOfTestPage() { ...@@ -162,13 +162,13 @@ id<GREYMatcher> TitleOfTestPage() {
// Sign-in promo should be visible with cold state. // Sign-in promo should be visible with cold state.
[SigninEarlGreyUI checkSigninPromoVisibleWithMode:SigninPromoViewModeColdState [SigninEarlGreyUI checkSigninPromoVisibleWithMode:SigninPromoViewModeColdState
closeButton:NO]; closeButton:NO];
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
// Sign-in promo should be visible with warm state. // Sign-in promo should be visible with warm state.
[SigninEarlGreyUI checkSigninPromoVisibleWithMode:SigninPromoViewModeWarmState [SigninEarlGreyUI checkSigninPromoVisibleWithMode:SigninPromoViewModeWarmState
closeButton:NO]; closeButton:NO];
[self closeRecentTabs]; [self closeRecentTabs];
[SigninEarlGreyUtils removeFakeIdentity:fakeIdentity]; [SigninEarlGrey removeFakeIdentity:fakeIdentity];
} }
// Tests that the sign-in promo can be reloaded correctly while being hidden. // Tests that the sign-in promo can be reloaded correctly while being hidden.
...@@ -189,8 +189,8 @@ id<GREYMatcher> TitleOfTestPage() { ...@@ -189,8 +189,8 @@ id<GREYMatcher> TitleOfTestPage() {
[SigninEarlGreyUI checkSigninPromoNotVisible]; [SigninEarlGreyUI checkSigninPromoNotVisible];
// Add an account. // Add an account.
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
// Tap on "Other Devices", to show the sign-in promo. // Tap on "Other Devices", to show the sign-in promo.
[[EarlGrey selectElementWithMatcher:otherDevicesMatcher] [[EarlGrey selectElementWithMatcher:otherDevicesMatcher]
...@@ -198,7 +198,7 @@ id<GREYMatcher> TitleOfTestPage() { ...@@ -198,7 +198,7 @@ id<GREYMatcher> TitleOfTestPage() {
[SigninEarlGreyUI checkSigninPromoVisibleWithMode:SigninPromoViewModeWarmState [SigninEarlGreyUI checkSigninPromoVisibleWithMode:SigninPromoViewModeWarmState
closeButton:NO]; closeButton:NO];
[self closeRecentTabs]; [self closeRecentTabs];
[SigninEarlGreyUtils removeFakeIdentity:fakeIdentity]; [SigninEarlGrey removeFakeIdentity:fakeIdentity];
} }
// Tests that the VC can be dismissed by swiping down. // Tests that the VC can be dismissed by swiping down.
...@@ -234,7 +234,7 @@ id<GREYMatcher> TitleOfTestPage() { ...@@ -234,7 +234,7 @@ id<GREYMatcher> TitleOfTestPage() {
// Tests that the Recent Tabs can be opened while signed in (prevent regression // Tests that the Recent Tabs can be opened while signed in (prevent regression
// for https://crbug.com/1056613). // for https://crbug.com/1056613).
- (void)testOpenWhileSignedIn { - (void)testOpenWhileSignedIn {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
OpenRecentTabsPanel(); OpenRecentTabsPanel();
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "base/test/scoped_feature_list.h" #import "base/test/scoped_feature_list.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.h" #import "ios/chrome/browser/ui/bookmarks/bookmark_earl_grey_ui.h"
#import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h" #import "ios/chrome/browser/ui/settings/google_services/accounts_table_view_controller_constants.h"
...@@ -76,7 +76,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -76,7 +76,7 @@ id<GREYMatcher> NoBookmarksLabel() {
// Tests that the Sync and Account Settings screen are correctly popped if the // Tests that the Sync and Account Settings screen are correctly popped if the
// signed in account is removed. // signed in account is removed.
- (void)testSignInPopUpAccountOnSyncSettings { - (void)testSignInPopUpAccountOnSyncSettings {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
// Sign In |identity|, then open the Sync Settings. // Sign In |identity|, then open the Sync Settings.
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
...@@ -85,11 +85,11 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -85,11 +85,11 @@ id<GREYMatcher> NoBookmarksLabel() {
// Forget |fakeIdentity|, screens should be popped back to the Main Settings. // Forget |fakeIdentity|, screens should be popped back to the Main Settings.
[ChromeEarlGreyUI waitForAppToIdle]; [ChromeEarlGreyUI waitForAppToIdle];
[SigninEarlGreyUtils forgetFakeIdentity:fakeIdentity]; [SigninEarlGrey forgetFakeIdentity:fakeIdentity];
[[EarlGrey selectElementWithMatcher:PrimarySignInButton()] [[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
[SigninEarlGreyUtils checkSignedOut]; [SigninEarlGrey checkSignedOut];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -98,8 +98,8 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -98,8 +98,8 @@ id<GREYMatcher> NoBookmarksLabel() {
// Tests that the Account Settings screen is correctly popped if the signed in // Tests that the Account Settings screen is correctly popped if the signed in
// account is removed while the "Disconnect Account" dialog is up. // account is removed while the "Disconnect Account" dialog is up.
- (void)testSignInPopUpAccountOnDisconnectAccount { - (void)testSignInPopUpAccountOnDisconnectAccount {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
// Sign In |fakeIdentity|, then open the Account Settings. // Sign In |fakeIdentity|, then open the Account Settings.
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
...@@ -109,11 +109,11 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -109,11 +109,11 @@ id<GREYMatcher> NoBookmarksLabel() {
// Forget |fakeIdentity|, screens should be popped back to the Main Settings. // Forget |fakeIdentity|, screens should be popped back to the Main Settings.
[ChromeEarlGreyUI waitForAppToIdle]; [ChromeEarlGreyUI waitForAppToIdle];
[SigninEarlGreyUtils forgetFakeIdentity:fakeIdentity]; [SigninEarlGrey forgetFakeIdentity:fakeIdentity];
[[EarlGrey selectElementWithMatcher:PrimarySignInButton()] [[EarlGrey selectElementWithMatcher:PrimarySignInButton()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
[SigninEarlGreyUtils checkSignedOut]; [SigninEarlGrey checkSignedOut];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -122,9 +122,9 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -122,9 +122,9 @@ id<GREYMatcher> NoBookmarksLabel() {
// Tests that the Account Settings screen is correctly reloaded when one of // Tests that the Account Settings screen is correctly reloaded when one of
// the non-primary account is removed. // the non-primary account is removed.
- (void)testSignInReloadOnRemoveAccount { - (void)testSignInReloadOnRemoveAccount {
FakeChromeIdentity* fakeIdentity1 = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity1 = [SigninEarlGrey fakeIdentity1];
FakeChromeIdentity* fakeIdentity2 = [SigninEarlGreyUtils fakeIdentity2]; FakeChromeIdentity* fakeIdentity2 = [SigninEarlGrey fakeIdentity2];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity2]; [SigninEarlGrey addFakeIdentity:fakeIdentity2];
// Sign In |fakeIdentity|, then open the Account Settings. // Sign In |fakeIdentity|, then open the Account Settings.
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity1]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity1];
...@@ -148,7 +148,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -148,7 +148,7 @@ id<GREYMatcher> NoBookmarksLabel() {
fakeIdentity2.userEmail), fakeIdentity2.userEmail),
grey_sufficientlyVisible(), nil)] grey_sufficientlyVisible(), nil)]
assertWithMatcher:grey_nil()]; assertWithMatcher:grey_nil()];
[SigninEarlGreyUtils checkSignedInWithFakeIdentity:fakeIdentity1]; [SigninEarlGrey checkSignedInWithFakeIdentity:fakeIdentity1];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -157,7 +157,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -157,7 +157,7 @@ id<GREYMatcher> NoBookmarksLabel() {
// Tests that the Account Settings screen is popped and the user signed out // Tests that the Account Settings screen is popped and the user signed out
// when the account is removed. // when the account is removed.
- (void)testSignOutOnRemoveAccount { - (void)testSignOutOnRemoveAccount {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
// Sign In |fakeIdentity|, then open the Account Settings. // Sign In |fakeIdentity|, then open the Account Settings.
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
...@@ -177,7 +177,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -177,7 +177,7 @@ id<GREYMatcher> NoBookmarksLabel() {
// 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()];
[SigninEarlGreyUtils checkSignedOut]; [SigninEarlGrey checkSignedOut];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -186,7 +186,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -186,7 +186,7 @@ id<GREYMatcher> NoBookmarksLabel() {
// Tests that selecting sign-out from a non-managed account keeps the user's // Tests that selecting sign-out from a non-managed account keeps the user's
// synced data. // synced data.
- (void)testSignOutFromNonManagedAccountKeepsData { - (void)testSignOutFromNonManagedAccountKeepsData {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
// Sign In |fakeIdentity|. // Sign In |fakeIdentity|.
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
...@@ -212,7 +212,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -212,7 +212,7 @@ id<GREYMatcher> NoBookmarksLabel() {
// Tests that selecting sign-out and clear data from a non-managed user account // Tests that selecting sign-out and clear data from a non-managed user account
// clears the user's synced data. // clears the user's synced data.
- (void)testSignOutAndClearDataFromNonManagedAccountClearsData { - (void)testSignOutAndClearDataFromNonManagedAccountClearsData {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
// Sign In |fakeIdentity|. // Sign In |fakeIdentity|.
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
...@@ -237,7 +237,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -237,7 +237,7 @@ id<GREYMatcher> NoBookmarksLabel() {
// Tests that signing out from a managed user account clears the user's data. // Tests that signing out from a managed user account clears the user's data.
- (void)testsSignOutFromManagedAccount { - (void)testsSignOutFromManagedAccount {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeManagedIdentity]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeManagedIdentity];
// Sign In |fakeIdentity|. // Sign In |fakeIdentity|.
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity isManagedAccount:YES]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity isManagedAccount:YES];
...@@ -270,7 +270,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -270,7 +270,7 @@ id<GREYMatcher> NoBookmarksLabel() {
#define MAYBE_testSignInDisconnectCancelled testSignInDisconnectCancelled #define MAYBE_testSignInDisconnectCancelled testSignInDisconnectCancelled
#endif #endif
- (void)MAYBE_testSignInDisconnectCancelled { - (void)MAYBE_testSignInDisconnectCancelled {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
// Sign In |fakeIdentity|, then open the Account Settings. // Sign In |fakeIdentity|, then open the Account Settings.
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
...@@ -290,7 +290,7 @@ id<GREYMatcher> NoBookmarksLabel() { ...@@ -290,7 +290,7 @@ id<GREYMatcher> NoBookmarksLabel() {
[[EarlGrey selectElementWithMatcher:chrome_test_util:: [[EarlGrey selectElementWithMatcher:chrome_test_util::
SettingsAccountsCollectionView()] SettingsAccountsCollectionView()]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
[SigninEarlGreyUtils checkSignedInWithFakeIdentity:fakeIdentity]; [SigninEarlGrey checkSignedInWithFakeIdentity:fakeIdentity];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()] [[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
#include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h" #include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "components/safe_browsing/core/features.h" #include "components/safe_browsing/core/features.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/browser/ui/settings/google_services/google_services_settings_app_interface.h" #import "ios/chrome/browser/ui/settings/google_services/google_services_settings_app_interface.h"
#import "ios/chrome/browser/ui/settings/google_services/google_services_settings_constants.h" #import "ios/chrome/browser/ui/settings/google_services/google_services_settings_constants.h"
#import "ios/chrome/browser/ui/settings/google_services/manage_sync_settings_constants.h" #import "ios/chrome/browser/ui/settings/google_services/manage_sync_settings_constants.h"
...@@ -91,12 +91,12 @@ using chrome_test_util::SettingsDoneButton; ...@@ -91,12 +91,12 @@ using chrome_test_util::SettingsDoneButton;
// Regression test for crbug.com/1033901 // Regression test for crbug.com/1033901
- (void)testRemovePrimaryAccount { - (void)testRemovePrimaryAccount {
// Signin. // Signin.
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
// Open "Google Services" settings. // Open "Google Services" settings.
[self openGoogleServicesSettings]; [self openGoogleServicesSettings];
// Remove the primary account. // Remove the primary account.
[SigninEarlGreyUtils forgetFakeIdentity:fakeIdentity]; [SigninEarlGrey forgetFakeIdentity:fakeIdentity];
// Assert the UI has been reloaded by testing for the signin cell being // Assert the UI has been reloaded by testing for the signin cell being
// visible. // visible.
id<GREYMatcher> signinCellMatcher = id<GREYMatcher> signinCellMatcher =
...@@ -122,8 +122,8 @@ using chrome_test_util::SettingsDoneButton; ...@@ -122,8 +122,8 @@ using chrome_test_util::SettingsDoneButton;
[GoogleServicesSettingsAppInterface [GoogleServicesSettingsAppInterface
unblockAllNavigationRequestsForCurrentWebState]; unblockAllNavigationRequestsForCurrentWebState];
}]; }];
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
// Open "Google Services" settings. // Open "Google Services" settings.
[self openGoogleServicesSettings]; [self openGoogleServicesSettings];
// Open sign-in. // Open sign-in.
...@@ -163,7 +163,7 @@ using chrome_test_util::SettingsDoneButton; ...@@ -163,7 +163,7 @@ using chrome_test_util::SettingsDoneButton;
// See: crbug.com/1076843 // See: crbug.com/1076843
- (void)testOpenSSOAddAccount { - (void)testOpenSSOAddAccount {
// Signin. // Signin.
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
// Open "Google Services" settings. // Open "Google Services" settings.
[self openGoogleServicesSettings]; [self openGoogleServicesSettings];
...@@ -234,7 +234,7 @@ using chrome_test_util::SettingsDoneButton; ...@@ -234,7 +234,7 @@ using chrome_test_util::SettingsDoneButton;
forUserPref:password_manager::prefs::kPasswordLeakDetectionEnabled]; forUserPref:password_manager::prefs::kPasswordLeakDetectionEnabled];
// Sign in. // Sign in.
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
// Open "Google Services" settings. // Open "Google Services" settings.
[self openGoogleServicesSettings]; [self openGoogleServicesSettings];
...@@ -294,7 +294,7 @@ using chrome_test_util::SettingsDoneButton; ...@@ -294,7 +294,7 @@ using chrome_test_util::SettingsDoneButton;
forUserPref:password_manager::prefs::kPasswordLeakDetectionEnabled]; forUserPref:password_manager::prefs::kPasswordLeakDetectionEnabled];
// Sign in. // Sign in.
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
// Open "Google Services" settings. // Open "Google Services" settings.
[self openGoogleServicesSettings]; [self openGoogleServicesSettings];
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/authentication/cells/signin_promo_view_constants.h" #import "ios/chrome/browser/ui/authentication/cells/signin_promo_view_constants.h"
#import "ios/chrome/browser/ui/authentication/signin/signin_constants.h" #import "ios/chrome/browser/ui/authentication/signin/signin_constants.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h" #import "ios/chrome/browser/ui/settings/settings_table_view_controller_constants.h"
#import "ios/chrome/browser/ui/settings/signin_settings_app_interface.h" #import "ios/chrome/browser/ui/settings/signin_settings_app_interface.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
...@@ -55,8 +55,8 @@ using chrome_test_util::ButtonWithAccessibilityLabelId; ...@@ -55,8 +55,8 @@ using chrome_test_util::ButtonWithAccessibilityLabelId;
// Tests signing in, using the primary button with a warm state. // Tests signing in, using the primary button with a warm state.
- (void)testSignInPromoWithWarmStateUsingPrimaryButton { - (void)testSignInPromoWithWarmStateUsingPrimaryButton {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
[SigninEarlGreyUI [SigninEarlGreyUI
...@@ -65,7 +65,7 @@ using chrome_test_util::ButtonWithAccessibilityLabelId; ...@@ -65,7 +65,7 @@ using chrome_test_util::ButtonWithAccessibilityLabelId;
[SigninEarlGreyUI confirmSigninConfirmationDialog]; [SigninEarlGreyUI confirmSigninConfirmationDialog];
// User signed in. // User signed in.
[SigninEarlGreyUtils checkSignedInWithFakeIdentity:fakeIdentity]; [SigninEarlGrey checkSignedInWithFakeIdentity:fakeIdentity];
[SigninEarlGreyUI checkSigninPromoNotVisible]; [SigninEarlGreyUI checkSigninPromoNotVisible];
[[EarlGrey selectElementWithMatcher:SettingsAccountButton()] [[EarlGrey selectElementWithMatcher:SettingsAccountButton()]
assertWithMatcher:grey_interactable()]; assertWithMatcher:grey_interactable()];
...@@ -73,8 +73,8 @@ using chrome_test_util::ButtonWithAccessibilityLabelId; ...@@ -73,8 +73,8 @@ using chrome_test_util::ButtonWithAccessibilityLabelId;
// Tests signing in, using the secondary button with a warm state. // Tests signing in, using the secondary button with a warm state.
- (void)testSignInPromoWithWarmStateUsingSecondaryButton { - (void)testSignInPromoWithWarmStateUsingSecondaryButton {
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUtils addFakeIdentity:fakeIdentity]; [SigninEarlGrey addFakeIdentity:fakeIdentity];
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
[SigninEarlGreyUI [SigninEarlGreyUI
...@@ -84,7 +84,7 @@ using chrome_test_util::ButtonWithAccessibilityLabelId; ...@@ -84,7 +84,7 @@ using chrome_test_util::ButtonWithAccessibilityLabelId;
[SigninEarlGreyUI confirmSigninConfirmationDialog]; [SigninEarlGreyUI confirmSigninConfirmationDialog];
// User signed in. // User signed in.
[SigninEarlGreyUtils checkSignedInWithFakeIdentity:fakeIdentity]; [SigninEarlGrey checkSignedInWithFakeIdentity:fakeIdentity];
[SigninEarlGreyUI checkSigninPromoNotVisible]; [SigninEarlGreyUI checkSigninPromoNotVisible];
[[EarlGrey selectElementWithMatcher:SettingsAccountButton()] [[EarlGrey selectElementWithMatcher:SettingsAccountButton()]
assertWithMatcher:grey_interactable()]; assertWithMatcher:grey_interactable()];
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
// found in the LICENSE file. // found in the LICENSE file.
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/authentication/signin_earl_grey.h"
#import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h" #import "ios/chrome/browser/ui/authentication/signin_earl_grey_ui.h"
#import "ios/chrome/browser/ui/authentication/signin_earlgrey_utils.h"
#import "ios/chrome/grit/ios_strings.h" #import "ios/chrome/grit/ios_strings.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"
...@@ -28,7 +28,7 @@ using chrome_test_util::NavigationBarCancelButton; ...@@ -28,7 +28,7 @@ using chrome_test_util::NavigationBarCancelButton;
- (void)testShowSyncPassphraseAndDismiss { - (void)testShowSyncPassphraseAndDismiss {
[ChromeEarlGrey addBookmarkWithSyncPassphrase:@"hello"]; [ChromeEarlGrey addBookmarkWithSyncPassphrase:@"hello"];
// Signin. // Signin.
FakeChromeIdentity* fakeIdentity = [SigninEarlGreyUtils fakeIdentity1]; FakeChromeIdentity* fakeIdentity = [SigninEarlGrey fakeIdentity1];
[SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity]; [SigninEarlGreyUI signinWithFakeIdentity:fakeIdentity];
[ChromeEarlGrey openNewTab]; [ChromeEarlGrey openNewTab];
[[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabelId( [[EarlGrey selectElementWithMatcher:ButtonWithAccessibilityLabelId(
......
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