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