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; ...@@ -29,6 +29,7 @@ using chrome_test_util::SecondarySignInButton;
using chrome_test_util::SettingsAccountButton; using chrome_test_util::SettingsAccountButton;
using chrome_test_util::SettingsDoneButton; using chrome_test_util::SettingsDoneButton;
using chrome_test_util::SignOutAccountsButton; using chrome_test_util::SignOutAccountsButton;
using chrome_test_util::SignOutAndClearDataAccountsButton;
using chrome_test_util::UnifiedConsentAddAccountButton; using chrome_test_util::UnifiedConsentAddAccountButton;
@implementation SigninEarlGreyUI @implementation SigninEarlGreyUI
...@@ -193,19 +194,22 @@ using chrome_test_util::UnifiedConsentAddAccountButton; ...@@ -193,19 +194,22 @@ using chrome_test_util::UnifiedConsentAddAccountButton;
(SignOutConfirmation)signOutConfirmation { (SignOutConfirmation)signOutConfirmation {
[ChromeEarlGreyUI openSettingsMenu]; [ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()]; [ChromeEarlGreyUI tapSettingsMenuButton:SettingsAccountButton()];
[ChromeEarlGreyUI tapAccountsMenuButton:SignOutAccountsButton()];
int confirmationLabelID = 0; int confirmationLabelID = 0;
id<GREYMatcher> signOutButton;
switch (signOutConfirmation) { switch (signOutConfirmation) {
case SignOutConfirmationManagedUser: { case SignOutConfirmationManagedUser: {
confirmationLabelID = IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT_UNITY; confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE;
signOutButton = SignOutAndClearDataAccountsButton();
break; break;
} }
case SignOutConfirmationNonManagedUser: { case SignOutConfirmationNonManagedUser: {
confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE; confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE;
signOutButton = SignOutAccountsButton();
break; break;
} }
case SignOutConfirmationNonManagedUserWithClearedData: { case SignOutConfirmationNonManagedUserWithClearedData: {
confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE; confirmationLabelID = IDS_IOS_DISCONNECT_DIALOG_CONTINUE_AND_CLEAR_MOBILE;
signOutButton = SignOutAccountsButton();
break; break;
} }
default: { default: {
...@@ -214,9 +218,11 @@ using chrome_test_util::UnifiedConsentAddAccountButton; ...@@ -214,9 +218,11 @@ using chrome_test_util::UnifiedConsentAddAccountButton;
} }
} }
id<GREYMatcher> confirmationButtonMatcher = [ChromeMatchersAppInterface [ChromeEarlGreyUI tapAccountsMenuButton:signOutButton];
buttonWithAccessibilityLabelID:confirmationLabelID]; [[EarlGrey selectElementWithMatcher:
[[EarlGrey selectElementWithMatcher:confirmationButtonMatcher] grey_allOf(chrome_test_util::ButtonWithAccessibilityLabelId(
confirmationLabelID),
grey_not(signOutButton), nil)]
performAction:grey_tap()]; performAction:grey_tap()];
// Wait until the user is signed out. // Wait until the user is signed out.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle]; [[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
......
...@@ -149,6 +149,9 @@ id<GREYMatcher> AddAccountButton(); ...@@ -149,6 +149,9 @@ id<GREYMatcher> AddAccountButton();
// Returns matcher for the sign out accounts button. // Returns matcher for the sign out accounts button.
id<GREYMatcher> SignOutAccountsButton(); 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. // Returns matcher for the Clear Browsing Data cell on the Privacy screen.
id<GREYMatcher> ClearBrowsingDataCell(); id<GREYMatcher> ClearBrowsingDataCell();
......
...@@ -195,6 +195,10 @@ id<GREYMatcher> SignOutAccountsButton() { ...@@ -195,6 +195,10 @@ id<GREYMatcher> SignOutAccountsButton() {
return [ChromeMatchersAppInterface signOutAccountsButton]; return [ChromeMatchersAppInterface signOutAccountsButton];
} }
id<GREYMatcher> SignOutAndClearDataAccountsButton() {
return [ChromeMatchersAppInterface signOutAndClearDataAccountsButton];
}
id<GREYMatcher> ClearBrowsingDataCell() { id<GREYMatcher> ClearBrowsingDataCell() {
return [ChromeMatchersAppInterface clearBrowsingDataCell]; return [ChromeMatchersAppInterface clearBrowsingDataCell];
} }
......
...@@ -153,6 +153,9 @@ ...@@ -153,6 +153,9 @@
// Returns matcher for the sign out accounts button. // Returns matcher for the sign out accounts button.
+ (id<GREYMatcher>)signOutAccountsButton; + (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. // Returns matcher for the Clear Browsing Data cell on the Privacy screen.
+ (id<GREYMatcher>)clearBrowsingDataCell; + (id<GREYMatcher>)clearBrowsingDataCell;
......
...@@ -424,6 +424,11 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id, ...@@ -424,6 +424,11 @@ UIView* SubviewWithAccessibilityIdentifier(NSString* accessibility_id,
return grey_accessibilityID(kSettingsAccountsTableViewSignoutCellId); return grey_accessibilityID(kSettingsAccountsTableViewSignoutCellId);
} }
+ (id<GREYMatcher>)signOutAndClearDataAccountsButton {
return grey_accessibilityID(
kSettingsAccountsTableViewSignoutAndClearDataCellId);
}
+ (id<GREYMatcher>)clearBrowsingDataCell { + (id<GREYMatcher>)clearBrowsingDataCell {
return [ChromeMatchersAppInterface return [ChromeMatchersAppInterface
buttonWithAccessibilityLabelID:(IDS_IOS_CLEAR_BROWSING_DATA_TITLE)]; buttonWithAccessibilityLabelID:(IDS_IOS_CLEAR_BROWSING_DATA_TITLE)];
......
...@@ -1477,6 +1477,21 @@ ...@@ -1477,6 +1477,21 @@
] ]
} }
], ],
"ClearSyncedData": [
{
"platforms": [
"ios"
],
"experiments": [
{
"name": "Enabled_20200407",
"enable_features": [
"ClearSyncedData"
]
}
]
}
],
"CompositeCrossOriginIframes": [ "CompositeCrossOriginIframes": [
{ {
"platforms": [ "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