Index: ios/chrome/browser/ui/settings/settings_egtest.mm |
diff --git a/ios/chrome/browser/ui/settings/settings_egtest.mm b/ios/chrome/browser/ui/settings/settings_egtest.mm |
index 34a3e09ee0f9cf592a77f7e22e0ac33248065928..87f28d3b7d47e786a36298e1d9003e8d3686c80b 100644 |
--- a/ios/chrome/browser/ui/settings/settings_egtest.mm |
+++ b/ios/chrome/browser/ui/settings/settings_egtest.mm |
@@ -94,10 +94,6 @@ |
id<GREYMatcher> ClearBrowsingDataButton() { |
return ButtonWithAccessibilityLabelId(IDS_IOS_CLEAR_BUTTON); |
} |
-// Matcher for the clear browsing data action sheet item. |
-id<GREYMatcher> ConfirmClearBrowsingDataButton() { |
- return ButtonWithAccessibilityLabelId(IDS_IOS_CONFIRM_CLEAR_BUTTON); |
-} |
// Matcher for the Settings button in the tools menu. |
id<GREYMatcher> SettingsButton() { |
return grey_accessibilityID(kToolsMenuSettingsId); |
@@ -287,8 +283,15 @@ |
- (void)clearBrowsingData { |
[[EarlGrey selectElementWithMatcher:ClearBrowsingDataButton()] |
performAction:grey_tap()]; |
- [[EarlGrey selectElementWithMatcher:ConfirmClearBrowsingDataButton()] |
- performAction:grey_tap()]; |
+ |
+ // There is not currently a matcher for accessibilityElementIsFocused or |
+ // userInteractionEnabled which could be used here instead of checking that |
+ // the button is not a MDCCollectionViewTextCell. Use when available. |
+ // TODO(crbug.com/638674): Evaluate if this can move to shared code. |
+ id<GREYMatcher> confirmClear = grey_allOf( |
+ ClearBrowsingDataButton(), |
+ grey_not(grey_kindOfClass([MDCCollectionViewTextCell class])), nil); |
+ [[EarlGrey selectElementWithMatcher:confirmClear] performAction:grey_tap()]; |
} |
// Exits Settings by clicking on the Done button. |
@@ -703,6 +706,7 @@ |
// Verifies that logging into a form on a web page allows the user to save and |
// then clear a password. |
- (void)testClearPasswords { |
+ |
ios::ChromeBrowserState* browserState = |
chrome_test_util::GetOriginalBrowserState(); |
PrefService* preferences = browserState->GetPrefs(); |