Commit d34f71da authored by Menglu Huang's avatar Menglu Huang Committed by Commit Bot

Revert "Enabling sign-in promo view earlgrey tests"

This reverts commit 91feaec9.

Reason for revert: <INSERT REASONING HERE>
This CL causes test fails about signin in settings_egtest.
https://build.chromium.org/p/chromium.fyi/builders/EarlGreyiOS/builds/30291 
You can use EG tryjob by
git cl try -m tryserver.chromium.mac -b ios-simulator-eg

Original change's description:
> Enabling sign-in promo view earlgrey tests
> 
> Bug: 661794
> Change-Id: I9e9844e73583288581e9700228708edc39dfd580
> Reviewed-on: https://chromium-review.googlesource.com/561147
> Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
> Reviewed-by: Eric Noyau <noyau@chromium.org>
> Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#491761}

TBR=msarda@chromium.org,noyau@chromium.org,jlebel@chromium.org

Change-Id: I26caf6ede4734b0ec89d275ef211ff93e4adf73d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 661794
Reviewed-on: https://chromium-review.googlesource.com/601098Reviewed-by: default avatarYuke Liao <liaoyuke@chromium.org>
Commit-Queue: Menglu Huang <huangml@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491880}
parent a0b15605
...@@ -188,7 +188,6 @@ source_set("eg_tests") { ...@@ -188,7 +188,6 @@ source_set("eg_tests") {
"//ios/chrome/browser", "//ios/chrome/browser",
"//ios/chrome/browser/signin", "//ios/chrome/browser/signin",
"//ios/chrome/browser/ui", "//ios/chrome/browser/ui",
"//ios/chrome/browser/ui/authentication:authentication_ui",
"//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/commands",
"//ios/chrome/browser/ui/ntp:ntp_controller", "//ios/chrome/browser/ui/ntp:ntp_controller",
"//ios/chrome/browser/ui/settings", "//ios/chrome/browser/ui/settings",
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "components/signin/core/browser/signin_manager.h" #include "components/signin/core/browser/signin_manager.h"
#include "ios/chrome/browser/experimental_flags.h" #include "ios/chrome/browser/experimental_flags.h"
#include "ios/chrome/browser/signin/signin_manager_factory.h" #include "ios/chrome/browser/signin/signin_manager_factory.h"
#import "ios/chrome/browser/ui/authentication/signin_promo_view.h"
#import "ios/chrome/browser/ui/commands/open_url_command.h" #import "ios/chrome/browser/ui/commands/open_url_command.h"
#import "ios/chrome/browser/ui/ntp/new_tab_page_controller.h" #import "ios/chrome/browser/ui/ntp/new_tab_page_controller.h"
#import "ios/chrome/browser/ui/settings/accounts_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/accounts_collection_view_controller.h"
...@@ -92,7 +91,7 @@ void TapButtonWithLabelId(int message_id) { ...@@ -92,7 +91,7 @@ void TapButtonWithLabelId(int message_id) {
// User must not be signed in. // User must not be signed in.
void OpenSignInFromSettings() { void OpenSignInFromSettings() {
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
TapViewWithAccessibilityId(kSigninPromoSecondaryButtonId); TapViewWithAccessibilityId(kSettingsSignInCellId);
} }
// Wait until |matcher| is accessible (not nil) // Wait until |matcher| is accessible (not nil)
...@@ -333,8 +332,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) { ...@@ -333,8 +332,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
TapButtonWithLabelId(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE); TapButtonWithLabelId(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE);
// Check that the settings home screen is shown. // Check that the settings home screen is shown.
WaitForMatcher(grey_allOf(grey_accessibilityID(kSigninPromoSecondaryButtonId), WaitForMatcher(grey_accessibilityID(kSettingsSignInCellId));
grey_sufficientlyVisible(), nil));
[[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -384,8 +382,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) { ...@@ -384,8 +382,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
TapButtonWithLabelId(IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT); TapButtonWithLabelId(IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT);
// Check that the settings home screen is shown. // Check that the settings home screen is shown.
WaitForMatcher(grey_allOf(grey_accessibilityID(kSigninPromoSecondaryButtonId), WaitForMatcher(grey_accessibilityID(kSettingsSignInCellId));
grey_sufficientlyVisible(), nil));
[[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -536,9 +533,8 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) { ...@@ -536,9 +533,8 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
AssertAuthenticatedIdentityInActiveProfile(nil); AssertAuthenticatedIdentityInActiveProfile(nil);
// Start sign-in with |identity1|. // Start sign-in with |identity1|.
WaitForMatcher(grey_allOf(grey_accessibilityID(kSigninPromoSecondaryButtonId), WaitForMatcher(grey_accessibilityID(kSettingsSignInCellId));
grey_sufficientlyVisible(), nil)); TapViewWithAccessibilityId(kSettingsSignInCellId);
TapViewWithAccessibilityId(kSigninPromoSecondaryButtonId);
TapButtonWithAccessibilityLabel(identity1.userEmail); TapButtonWithAccessibilityLabel(identity1.userEmail);
TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SIGNIN_BUTTON); TapButtonWithLabelId(IDS_IOS_ACCOUNT_CONSISTENCY_SETUP_SIGNIN_BUTTON);
...@@ -595,7 +591,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) { ...@@ -595,7 +591,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
[[EarlGrey selectElementWithMatcher:all_bookmarks_matcher] [[EarlGrey selectElementWithMatcher:all_bookmarks_matcher]
performAction:grey_tap()]; performAction:grey_tap()];
TapViewWithAccessibilityId(kSigninPromoSecondaryButtonId); TapButtonWithLabelId(IDS_IOS_BOOKMARK_PROMO_SIGN_IN_BUTTON);
// Assert sign-in screen was shown. // Assert sign-in screen was shown.
id<GREYMatcher> signin_matcher = id<GREYMatcher> signin_matcher =
...@@ -624,7 +620,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) { ...@@ -624,7 +620,7 @@ void AssertAuthenticatedIdentityInActiveProfile(ChromeIdentity* identity) {
} }
[[EarlGrey selectElementWithMatcher:all_bookmarks_matcher] [[EarlGrey selectElementWithMatcher:all_bookmarks_matcher]
performAction:grey_tap()]; performAction:grey_tap()];
TapViewWithAccessibilityId(kSigninPromoSecondaryButtonId); TapButtonWithLabelId(IDS_IOS_BOOKMARK_PROMO_SIGN_IN_BUTTON);
[[EarlGrey selectElementWithMatcher:signin_matcher] [[EarlGrey selectElementWithMatcher:signin_matcher]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_sufficientlyVisible()];
......
...@@ -20,11 +20,6 @@ typedef NS_ENUM(NSInteger, SigninPromoViewMode) { ...@@ -20,11 +20,6 @@ typedef NS_ENUM(NSInteger, SigninPromoViewMode) {
SigninPromoViewModeWarmState, SigninPromoViewModeWarmState,
}; };
extern NSString* const kSigninPromoViewId;
extern NSString* const kSigninPromoPrimaryButtonId;
extern NSString* const kSigninPromoSecondaryButtonId;
extern NSString* const kSigninPromoCloseButtonId;
// This class creates an image view, a label and 2 buttons. This view can be // This class creates an image view, a label and 2 buttons. This view can be
// configured with 2 modes : "Cold State" and "Warm State". // configured with 2 modes : "Cold State" and "Warm State".
// + "Cold State" mode displays the chomium icon in the image view, and only // + "Cold State" mode displays the chomium icon in the image view, and only
......
...@@ -32,12 +32,6 @@ const CGFloat kProfileImageFixedSize = 48; ...@@ -32,12 +32,6 @@ const CGFloat kProfileImageFixedSize = 48;
const CGFloat kButtonHeight = 36; const CGFloat kButtonHeight = 36;
} }
NSString* const kSigninPromoViewId = @"signin_promo_view";
NSString* const kSigninPromoPrimaryButtonId = @"signin_promo_primary_button";
NSString* const kSigninPromoSecondaryButtonId =
@"signin_promo_secondary_button";
NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button";
@implementation SigninPromoView { @implementation SigninPromoView {
NSArray<NSLayoutConstraint*>* _coldStateConstraints; NSArray<NSLayoutConstraint*>* _coldStateConstraints;
NSArray<NSLayoutConstraint*>* _warmStateConstraints; NSArray<NSLayoutConstraint*>* _warmStateConstraints;
...@@ -56,7 +50,6 @@ NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button"; ...@@ -56,7 +50,6 @@ NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button";
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
self.isAccessibilityElement = YES; self.isAccessibilityElement = YES;
self.accessibilityIdentifier = kSigninPromoViewId;
// Adding subviews. // Adding subviews.
self.clipsToBounds = YES; self.clipsToBounds = YES;
...@@ -70,7 +63,7 @@ NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button"; ...@@ -70,7 +63,7 @@ NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button";
_primaryButton = [[MDCFlatButton alloc] init]; _primaryButton = [[MDCFlatButton alloc] init];
_primaryButton.translatesAutoresizingMaskIntoConstraints = NO; _primaryButton.translatesAutoresizingMaskIntoConstraints = NO;
_primaryButton.accessibilityIdentifier = kSigninPromoPrimaryButtonId; _primaryButton.accessibilityIdentifier = @"signin_promo_primary_button";
_primaryButton.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail; _primaryButton.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
[_primaryButton addTarget:self [_primaryButton addTarget:self
action:@selector(onPrimaryButtonAction:) action:@selector(onPrimaryButtonAction:)
...@@ -79,7 +72,7 @@ NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button"; ...@@ -79,7 +72,7 @@ NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button";
_secondaryButton = [[MDCFlatButton alloc] init]; _secondaryButton = [[MDCFlatButton alloc] init];
_secondaryButton.translatesAutoresizingMaskIntoConstraints = NO; _secondaryButton.translatesAutoresizingMaskIntoConstraints = NO;
_secondaryButton.accessibilityIdentifier = kSigninPromoSecondaryButtonId; _secondaryButton.accessibilityIdentifier = @"signin_promo_secondary_button";
[_secondaryButton addTarget:self [_secondaryButton addTarget:self
action:@selector(onSecondaryButtonAction:) action:@selector(onSecondaryButtonAction:)
forControlEvents:UIControlEventTouchUpInside]; forControlEvents:UIControlEventTouchUpInside];
...@@ -87,7 +80,7 @@ NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button"; ...@@ -87,7 +80,7 @@ NSString* const kSigninPromoCloseButtonId = @"signin_promo_close_button";
_closeButton = [[UIButton alloc] init]; _closeButton = [[UIButton alloc] init];
_closeButton.translatesAutoresizingMaskIntoConstraints = NO; _closeButton.translatesAutoresizingMaskIntoConstraints = NO;
_closeButton.accessibilityIdentifier = kSigninPromoCloseButtonId; _closeButton.accessibilityIdentifier = @"signin_promo_close_button";
[self addSubview:_closeButton]; [self addSubview:_closeButton];
// Adding style. // Adding style.
......
...@@ -187,7 +187,6 @@ source_set("eg_tests") { ...@@ -187,7 +187,6 @@ source_set("eg_tests") {
"//ios/chrome/browser/bookmarks:bookmarks_utils", "//ios/chrome/browser/bookmarks:bookmarks_utils",
"//ios/chrome/browser/browser_state", "//ios/chrome/browser/browser_state",
"//ios/chrome/browser/ui", "//ios/chrome/browser/ui",
"//ios/chrome/browser/ui/authentication:authentication_ui",
"//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/commands",
"//ios/chrome/browser/ui/toolbar", "//ios/chrome/browser/ui/toolbar",
"//ios/chrome/browser/ui/tools_menu", "//ios/chrome/browser/ui/tools_menu",
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/experimental_flags.h" #include "ios/chrome/browser/experimental_flags.h"
#include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/pref_names.h"
#import "ios/chrome/browser/ui/authentication/signin_promo_view.h"
#import "ios/chrome/browser/ui/commands/generic_chrome_command.h" #import "ios/chrome/browser/ui/commands/generic_chrome_command.h"
#include "ios/chrome/browser/ui/commands/ios_command_ids.h" #include "ios/chrome/browser/ui/commands/ios_command_ids.h"
#import "ios/chrome/browser/ui/toolbar/toolbar_controller.h" #import "ios/chrome/browser/ui/toolbar/toolbar_controller.h"
...@@ -1096,16 +1095,16 @@ id<GREYMatcher> ActionSheet(Action action) { ...@@ -1096,16 +1095,16 @@ id<GREYMatcher> ActionSheet(Action action) {
}]; }];
// Check that promo is visible. // Check that promo is visible.
[BookmarksTestCase verifyPromoAlreadySeen:NO]; [BookmarksTestCase verifyPromoAlreadySeen:NO];
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(kSigninPromoViewId)] [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"promo_view")]
assertWithMatcher:grey_sufficientlyVisible()]; assertWithMatcher:grey_notNil()];
// Tap the dismiss button. // Tap the dismiss button.
[[EarlGrey [[EarlGrey
selectElementWithMatcher:grey_accessibilityID(kSigninPromoCloseButtonId)] selectElementWithMatcher:grey_accessibilityID(@"promo_no_thanks_button")]
performAction:grey_tap()]; performAction:grey_tap()];
// Wait until promo is gone. // Wait until promo is gone.
[[EarlGrey selectElementWithMatcher:grey_accessibilityID(kSigninPromoViewId)] [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"promo_view")]
assertWithMatcher:grey_notVisible()]; assertWithMatcher:grey_notVisible()];
// Check that the promo already seen state is updated. // Check that the promo already seen state is updated.
...@@ -1127,17 +1126,12 @@ id<GREYMatcher> ActionSheet(Action action) { ...@@ -1127,17 +1126,12 @@ id<GREYMatcher> ActionSheet(Action action) {
// Check that promo is visible. // Check that promo is visible.
[BookmarksTestCase verifyPromoAlreadySeen:NO]; [BookmarksTestCase verifyPromoAlreadySeen:NO];
[[EarlGrey [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"promo_view")]
selectElementWithMatcher:grey_allOf(
grey_accessibilityID(kSigninPromoViewId),
grey_sufficientlyVisible(), nil)]
assertWithMatcher:grey_notNil()]; assertWithMatcher:grey_notNil()];
// Tap the Sign in button. // Tap the Sign in button.
[[EarlGrey [[EarlGrey
selectElementWithMatcher:grey_allOf(grey_accessibilityID( selectElementWithMatcher:grey_accessibilityID(@"promo_sign_in_button")]
kSigninPromoSecondaryButtonId),
grey_sufficientlyVisible(), nil)]
performAction:grey_tap()]; performAction:grey_tap()];
// Tap the CANCEL button. // Tap the CANCEL button.
...@@ -1147,10 +1141,7 @@ id<GREYMatcher> ActionSheet(Action action) { ...@@ -1147,10 +1141,7 @@ id<GREYMatcher> ActionSheet(Action action) {
uppercaseString])] performAction:grey_tap()]; uppercaseString])] performAction:grey_tap()];
// Check that the bookmarks UI reappeared and the cell is still here. // Check that the bookmarks UI reappeared and the cell is still here.
[[EarlGrey [[EarlGrey selectElementWithMatcher:grey_accessibilityID(@"promo_view")]
selectElementWithMatcher:grey_allOf(
grey_accessibilityID(kSigninPromoViewId),
grey_sufficientlyVisible(), nil)]
assertWithMatcher:grey_notNil()]; assertWithMatcher:grey_notNil()];
[BookmarksTestCase verifyPromoAlreadySeen:NO]; [BookmarksTestCase verifyPromoAlreadySeen:NO];
......
...@@ -207,7 +207,6 @@ source_set("eg_tests") { ...@@ -207,7 +207,6 @@ source_set("eg_tests") {
"//ios/chrome/app/strings", "//ios/chrome/app/strings",
"//ios/chrome/browser", "//ios/chrome/browser",
"//ios/chrome/browser/browser_state", "//ios/chrome/browser/browser_state",
"//ios/chrome/browser/ui/authentication:authentication_ui",
"//ios/chrome/browser/ui/settings", "//ios/chrome/browser/ui/settings",
"//ios/chrome/browser/ui/tools_menu", "//ios/chrome/browser/ui/tools_menu",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/chrome_url_constants.h" #include "ios/chrome/browser/chrome_url_constants.h"
#import "ios/chrome/browser/ui/authentication/signin_promo_view.h"
#import "ios/chrome/browser/ui/history/history_entry_item.h" #import "ios/chrome/browser/ui/history/history_entry_item.h"
#import "ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.h"
#import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h"
...@@ -146,8 +145,8 @@ void MockSignIn() { ...@@ -146,8 +145,8 @@ void MockSignIn() {
identity); identity);
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
[[EarlGrey selectElementWithMatcher:grey_accessibilityID( [[EarlGrey
kSigninPromoSecondaryButtonId)] selectElementWithMatcher:grey_accessibilityID(kSettingsSignInCellId)]
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey [[EarlGrey
selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabel( selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabel(
......
...@@ -51,7 +51,6 @@ source_set("eg_tests") { ...@@ -51,7 +51,6 @@ source_set("eg_tests") {
"//ios/chrome/browser/bookmarks:bookmarks_utils", "//ios/chrome/browser/bookmarks:bookmarks_utils",
"//ios/chrome/browser/signin", "//ios/chrome/browser/signin",
"//ios/chrome/browser/sync", "//ios/chrome/browser/sync",
"//ios/chrome/browser/ui/authentication:authentication_ui",
"//ios/chrome/browser/ui/settings", "//ios/chrome/browser/ui/settings",
"//ios/chrome/browser/ui/tools_menu", "//ios/chrome/browser/ui/tools_menu",
"//ios/chrome/test/app:test_support", "//ios/chrome/test/app:test_support",
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "ios/chrome/browser/signin/authentication_service.h" #include "ios/chrome/browser/signin/authentication_service.h"
#include "ios/chrome/browser/signin/authentication_service_factory.h" #include "ios/chrome/browser/signin/authentication_service_factory.h"
#include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h" #include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h"
#import "ios/chrome/browser/ui/authentication/signin_promo_view.h"
#import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h" #import "ios/chrome/browser/ui/settings/settings_collection_view_controller.h"
#include "ios/chrome/browser/ui/tools_menu/tools_menu_constants.h" #include "ios/chrome/browser/ui/tools_menu/tools_menu_constants.h"
#import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h" #import "ios/chrome/browser/ui/tools_menu/tools_popup_controller.h"
...@@ -62,7 +61,7 @@ ChromeIdentity* GetFakeIdentity1() { ...@@ -62,7 +61,7 @@ ChromeIdentity* GetFakeIdentity1() {
void OpenSignInFromSettings() { void OpenSignInFromSettings() {
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
id<GREYMatcher> matcher = id<GREYMatcher> matcher =
grey_allOf(grey_accessibilityID(kSigninPromoSecondaryButtonId), grey_allOf(grey_accessibilityID(kSettingsSignInCellId),
grey_sufficientlyVisible(), nil); grey_sufficientlyVisible(), nil);
[[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()]; [[EarlGrey selectElementWithMatcher:matcher] performAction:grey_tap()];
} }
......
...@@ -66,7 +66,6 @@ source_set("test_support") { ...@@ -66,7 +66,6 @@ source_set("test_support") {
"//ios/chrome/browser/sync", "//ios/chrome/browser/sync",
"//ios/chrome/browser/tabs", "//ios/chrome/browser/tabs",
"//ios/chrome/browser/ui:ui_internal", "//ios/chrome/browser/ui:ui_internal",
"//ios/chrome/browser/ui/authentication:authentication_ui",
"//ios/chrome/browser/ui/commands", "//ios/chrome/browser/ui/commands",
"//ios/chrome/browser/ui/main", "//ios/chrome/browser/ui/main",
"//ios/chrome/browser/ui/ntp:ntp_controller", "//ios/chrome/browser/ui/ntp:ntp_controller",
......
...@@ -25,10 +25,6 @@ void TearDownMockAccountReconcilor(); ...@@ -25,10 +25,6 @@ void TearDownMockAccountReconcilor();
// the accounts were correctly removed from the keychain. // the accounts were correctly removed from the keychain.
bool SignOutAndClearAccounts(); bool SignOutAndClearAccounts();
// Resets Sign-in promo impression preferences for bookmarks and settings view,
// and resets kIosBookmarkPromoAlreadySeen flag for bookmarks.
void ResetSigninPromoPreferences();
} // namespace chrome_test_util } // namespace chrome_test_util
#endif // IOS_CHROME_TEST_APP_SIGNIN_TEST_UTIL_H_ #endif // IOS_CHROME_TEST_APP_SIGNIN_TEST_UTIL_H_
...@@ -12,12 +12,10 @@ ...@@ -12,12 +12,10 @@
#include "components/signin/core/common/signin_pref_names.h" #include "components/signin/core/common/signin_pref_names.h"
#include "google_apis/gaia/gaia_constants.h" #include "google_apis/gaia/gaia_constants.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/pref_names.h"
#include "ios/chrome/browser/signin/account_tracker_service_factory.h" #include "ios/chrome/browser/signin/account_tracker_service_factory.h"
#import "ios/chrome/browser/signin/authentication_service.h" #import "ios/chrome/browser/signin/authentication_service.h"
#include "ios/chrome/browser/signin/authentication_service_factory.h" #include "ios/chrome/browser/signin/authentication_service_factory.h"
#include "ios/chrome/browser/signin/gaia_auth_fetcher_ios.h" #include "ios/chrome/browser/signin/gaia_auth_fetcher_ios.h"
#import "ios/chrome/browser/ui/authentication/signin_promo_view.h"
#import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
#import "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/chrome_browser_provider.h"
#import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h" #import "ios/public/provider/chrome/browser/signin/fake_chrome_identity_service.h"
...@@ -174,12 +172,4 @@ bool SignOutAndClearAccounts() { ...@@ -174,12 +172,4 @@ bool SignOutAndClearAccounts() {
return !identity_service->HasIdentities(); return !identity_service->HasIdentities();
} }
void ResetSigninPromoPreferences() {
ios::ChromeBrowserState* browser_state = GetOriginalBrowserState();
PrefService* prefs = browser_state->GetPrefs();
prefs->SetInteger(prefs::kIosBookmarkSigninPromoDisplayedCount, 0);
prefs->SetBoolean(prefs::kIosBookmarkPromoAlreadySeen, false);
prefs->SetInteger(prefs::kIosSettingsSigninPromoDisplayedCount, 0);
}
} // namespace chrome_test_util } // namespace chrome_test_util
...@@ -180,7 +180,6 @@ source_set("test_support") { ...@@ -180,7 +180,6 @@ source_set("test_support") {
deps = [ deps = [
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//components/signin/core/common",
"//components/strings", "//components/strings",
"//ios/chrome/app/strings", "//ios/chrome/app/strings",
"//ios/chrome/browser/ui", "//ios/chrome/browser/ui",
......
...@@ -8,10 +8,8 @@ ...@@ -8,10 +8,8 @@
#import <EarlGrey/EarlGrey.h> #import <EarlGrey/EarlGrey.h>
#include "base/command_line.h"
#include "base/mac/scoped_block.h" #include "base/mac/scoped_block.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "components/signin/core/common/signin_switches.h"
#import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/chrome_test_util.h"
#include "ios/chrome/test/app/settings_test_util.h" #include "ios/chrome/test/app/settings_test_util.h"
#include "ios/chrome/test/app/signin_test_util.h" #include "ios/chrome/test/app/signin_test_util.h"
...@@ -165,7 +163,6 @@ const CFTimeInterval kDrainTimeout = 5; ...@@ -165,7 +163,6 @@ const CFTimeInterval kDrainTimeout = 5;
_isMockAuthenticationDisabled = NO; _isMockAuthenticationDisabled = NO;
_tearDownHandler = nil; _tearDownHandler = nil;
chrome_test_util::ResetSigninPromoPreferences();
chrome_test_util::OpenNewTab(); chrome_test_util::OpenNewTab();
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
} }
...@@ -250,11 +247,6 @@ const CFTimeInterval kDrainTimeout = 5; ...@@ -250,11 +247,6 @@ const CFTimeInterval kDrainTimeout = 5;
} }
+ (void)enableMockAuthentication { + (void)enableMockAuthentication {
// Enable sign-in promo for all tests.
// TODO(crbug.com/739910): Remove this line when the sign-in promo is enabled
// by default.
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableSigninPromo);
chrome_test_util::SetUpMockAuthentication(); chrome_test_util::SetUpMockAuthentication();
chrome_test_util::SetUpMockAccountReconcilor(); chrome_test_util::SetUpMockAccountReconcilor();
chrome_test_util::SetUpFakeSyncServer(); chrome_test_util::SetUpFakeSyncServer();
......
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