Commit c62a83d8 authored by Nohemi Fernandez's avatar Nohemi Fernandez Committed by Commit Bot

[iOS] Enable ClearSyncedData in fieldtrial_testing_config.json.

This enables the option on iOS Signout to clear all Chrome browsing data
in preparation for release to Stable.

Bug: 1005509
Change-Id: Ice46f42e681380d82c593d5b61a35701fc082acd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2214899Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774087}
parent c6b0a7f2
......@@ -29,6 +29,7 @@ using chrome_test_util::SecondarySignInButton;
using chrome_test_util::SettingsAccountButton;
using chrome_test_util::SettingsDoneButton;
using chrome_test_util::SignOutAccountsButton;
using chrome_test_util::SignOutAndClearDataAccountsButton;
using chrome_test_util::UnifiedConsentAddAccountButton;
@implementation SigninEarlGreyUI
......@@ -193,30 +194,29 @@ using chrome_test_util::UnifiedConsentAddAccountButton;
(SignOutConfirmation)signOutConfirmation {
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()];
[ChromeEarlGreyUI tapAccountsMenuButton:SignOutAccountsButton()];
id<GREYMatcher> signOutButtonMatcher;
int confirmationLabelID = 0;
switch (signOutConfirmation) {
case SignOutConfirmationManagedUser: {
confirmationLabelID = IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT_UNITY;
break;
}
case SignOutConfirmationNonManagedUser: {
signOutButtonMatcher = SignOutAccountsButton();
confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE;
break;
}
case SignOutConfirmationManagedUser:
case SignOutConfirmationNonManagedUserWithClearedData: {
signOutButtonMatcher = SignOutAndClearDataAccountsButton();
confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE;
break;
}
default: {
NOTREACHED();
break;
}
}
[ChromeEarlGreyUI tapAccountsMenuButton:signOutButtonMatcher];
id<GREYMatcher> confirmationButtonMatcher = [ChromeMatchersAppInterface
buttonWithAccessibilityLabelID:confirmationLabelID];
[[EarlGrey selectElementWithMatcher:confirmationButtonMatcher]
[[EarlGrey
selectElementWithMatcher:grey_allOf(confirmationButtonMatcher,
grey_not(signOutButtonMatcher), nil)]
performAction:grey_tap()];
// Wait until the user is signed out.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
......
......@@ -48,45 +48,6 @@ id<GREYMatcher> ButtonWithFakeIdentity(FakeChromeIdentity* fakeIdentity) {
id<GREYMatcher> NoBookmarksLabel() {
return grey_text(l10n_util::GetNSString(IDS_IOS_BOOKMARK_NO_BOOKMARKS_LABEL));
}
// Returns a matcher for the button to sign out and clear data.
id<GREYMatcher> SignOutAndClearDataButton() {
return grey_accessibilityID(
kSettingsAccountsTableViewSignoutAndClearDataCellId);
}
// Opens the list of accounts and taps the sign out button, |buttonMatcher|.
void SignOut(id<GREYMatcher> buttonMatcher, int labelID) {
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()];
[ChromeEarlGreyUI tapAccountsMenuButton:buttonMatcher];
// Both of the Buttons on the screen have the same label and traits. We need
// to match with the Button that does not have an accessibility label as this
// is the one created by the ActionSheetCoordinator.
[[EarlGrey selectElementWithMatcher:grey_allOf(ButtonWithAccessibilityLabelId(
labelID),
grey_not(buttonMatcher), nil)]
performAction:grey_tap()];
// Wait until the user is signed out.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
[[EarlGrey selectElementWithMatcher:SettingsDoneButton()]
performAction:grey_tap()];
[SigninEarlGreyUtils checkSignedOut];
}
// Signs out of account using the sign out button.
void SignOut() {
SignOut(SignOutAccountsButton(),
IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE);
}
// Signs out of account using the sign out and clear data button.
void SignOutAndClearData() {
SignOut(SignOutAndClearDataButton(),
IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE);
}
}
// Integration tests using the Account Settings screen.
......@@ -237,7 +198,9 @@ void SignOutAndClearData() {
[SigninEarlGreyUtilsAppInterface addBookmark:@"http://youtube.com"
withTitle:@"cats"];
SignOut();
// Sign out.
[SigninEarlGreyUI
signOutWithSignOutConfirmation:SignOutConfirmationNonManagedUser];
// Open the Bookmarks screen on the Tools menu.
[BookmarkEarlGreyUI openBookmarks];
......@@ -262,7 +225,9 @@ void SignOutAndClearData() {
[SigninEarlGreyUtilsAppInterface addBookmark:@"http://youtube.com"
withTitle:@"cats"];
SignOutAndClearData();
// Sign out.
[SigninEarlGreyUI signOutWithSignOutConfirmation:
SignOutConfirmationNonManagedUserWithClearedData];
// Open the Bookmarks screen on the Tools menu.
[BookmarkEarlGreyUI openBookmarks];
......@@ -286,7 +251,9 @@ void SignOutAndClearData() {
[SigninEarlGreyUtilsAppInterface addBookmark:@"http://youtube.com"
withTitle:@"cats"];
SignOutAndClearData();
// Sign out.
[SigninEarlGreyUI
signOutWithSignOutConfirmation:SignOutConfirmationManagedUser];
// Open the Bookmarks screen on the Tools menu.
[BookmarkEarlGreyUI openBookmarks];
......
......@@ -149,6 +149,9 @@ id<GREYMatcher> AddAccountButton();
// Returns matcher for the sign out accounts button.
id<GREYMatcher> SignOutAccountsButton();
// Returns matcher for the sign out and clear data accounts button.
id<GREYMatcher> SignOutAndClearDataAccountsButton();
// Returns matcher for the Clear Browsing Data cell on the Privacy screen.
id<GREYMatcher> ClearBrowsingDataCell();
......
......@@ -195,6 +195,10 @@ id<GREYMatcher> SignOutAccountsButton() {
return [ChromeMatchersAppInterface signOutAccountsButton];
}
id<GREYMatcher> SignOutAndClearDataAccountsButton() {
return [ChromeMatchersAppInterface signOutAndClearDataAccountsButton];
}
id<GREYMatcher> ClearBrowsingDataCell() {
return [ChromeMatchersAppInterface clearBrowsingDataCell];
}
......
......@@ -153,6 +153,9 @@
// Returns matcher for the sign out accounts button.
+ (id<GREYMatcher>)signOutAccountsButton;
// Returns matcher for the sign out and clear data accounts button.
+ (id<GREYMatcher>)signOutAndClearDataAccountsButton;
// Returns matcher for the Clear Browsing Data cell on the Privacy screen.
+ (id<GREYMatcher>)clearBrowsingDataCell;
......
......@@ -424,6 +424,11 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id,
return grey_accessibilityID(kSettingsAccountsTableViewSignoutCellId);
}
+ (id<GREYMatcher>)signOutAndClearDataAccountsButton {
return grey_accessibilityID(
kSettingsAccountsTableViewSignoutAndClearDataCellId);
}
+ (id<GREYMatcher>)clearBrowsingDataCell {
return [ChromeMatchersAppInterface
buttonWithAccessibilityLabelID:(IDS_IOS_CLEAR_BROWSING_DATA_TITLE)];
......
......@@ -1451,6 +1451,21 @@
]
}
],
"ClearSyncedData": [
{
"platforms": [
"ios"
],
"experiments": [
{
"name": "Enabled_20200407",
"enable_features": [
"ClearSyncedData"
]
}
]
}
],
"ClipboardMaximumAge": [
{
"platforms": [
......
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