Commit 65a40c3d authored by Nohemi Fernandez's avatar Nohemi Fernandez Committed by Commit Bot

[iOS] Add ClearSyncedData experiment to field trial testing.

Updates EarlGrey tests that are impacted by the new default signout UI.

Bug: 1005509
Change-Id: I688c15b7b3a7b77be6da9e87d2047dd831818aff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139708Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Commit-Queue: Nohemi Fernandez <fernandex@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758162}
parent 707b1949
......@@ -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,19 +194,22 @@ using chrome_test_util::UnifiedConsentAddAccountButton;
(SignOutConfirmation)signOutConfirmation {
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()];
[ChromeEarlGreyUI tapAccountsMenuButton:SignOutAccountsButton()];
int confirmationLabelID = 0;
id<GREYMatcher> signOutButton;
switch (signOutConfirmation) {
case SignOutConfirmationManagedUser: {
confirmationLabelID = IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT_UNITY;
confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE;
signOutButton = SignOutAndClearDataAccountsButton();
break;
}
case SignOutConfirmationNonManagedUser: {
confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE;
signOutButton = SignOutAccountsButton();
break;
}
case SignOutConfirmationNonManagedUserWithClearedData: {
confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE;
signOutButton = SignOutAccountsButton();
break;
}
default: {
......@@ -214,9 +218,11 @@ using chrome_test_util::UnifiedConsentAddAccountButton;
}
}
id<GREYMatcher> confirmationButtonMatcher = [ChromeMatchersAppInterface
buttonWithAccessibilityLabelID:confirmationLabelID];
[[EarlGrey selectElementWithMatcher:confirmationButtonMatcher]
[ChromeEarlGreyUI tapAccountsMenuButton:signOutButton];
[[EarlGrey selectElementWithMatcher:
grey_allOf(chrome_test_util::ButtonWithAccessibilityLabelId(
confirmationLabelID),
grey_not(signOutButton), nil)]
performAction:grey_tap()];
// Wait until the user is signed out.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
......
......@@ -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)];
......
......@@ -1477,6 +1477,21 @@
]
}
],
"ClearSyncedData": [
{
"platforms": [
"ios"
],
"experiments": [
{
"name": "Enabled_20200407",
"enable_features": [
"ClearSyncedData"
]
}
]
}
],
"CompositeCrossOriginIframes": [
{
"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