Commit 2c48bf2e authored by Vaclav Brozek's avatar Vaclav Brozek Committed by Commit Bot

Clear PasswordStore in tearDown in passwords_settings_egtest.mm

Most of the tests in passwords_settings_egtest.mm clear PasswordStore at the
end. It does not hurt to clear it in the rest of the tests either, because
clearing an empty store keeps it empty.

To reduce boilerplate, this CL moves the call to clear PasswordStore from
individual last lines of tests into the tearDown method of the fixture.

Bug: 744058
Change-Id: I350f73cef271534d01390d2e032b06e00afca0fb
Reviewed-on: https://chromium-review.googlesource.com/573542
Commit-Queue: Vaclav Brozek <vabr@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488264}
parent 098beb35
...@@ -407,6 +407,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -407,6 +407,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
// other tests. // other tests.
[MDCSnackbarManager [MDCSnackbarManager
dismissAndCallCompletionBlocksWithCategory:@"PasswordsSnackbarCategory"]; dismissAndCallCompletionBlocksWithCategory:@"PasswordsSnackbarCategory"];
ClearPasswordStore();
[super tearDown]; [super tearDown];
} }
...@@ -440,7 +443,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -440,7 +443,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that attempts to copy a password provide appropriate feedback, // Checks that attempts to copy a password provide appropriate feedback,
...@@ -488,7 +490,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -488,7 +490,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that attempts to copy a username provide appropriate feedback. // Checks that attempts to copy a username provide appropriate feedback.
...@@ -518,7 +519,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -518,7 +519,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that attempts to copy a site URL provide appropriate feedback. // Checks that attempts to copy a site URL provide appropriate feedback.
...@@ -548,7 +548,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -548,7 +548,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that deleting a password from password details view goes back to the // Checks that deleting a password from password details view goes back to the
...@@ -603,7 +602,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -603,7 +602,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that deleting a password from password details can be cancelled. // Checks that deleting a password from password details can be cancelled.
...@@ -652,7 +650,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -652,7 +650,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that if the list view is in edit mode, then the details password view // Checks that if the list view is in edit mode, then the details password view
...@@ -680,7 +677,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -680,7 +677,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that attempts to copy the site via the context menu item provide an // Checks that attempts to copy the site via the context menu item provide an
...@@ -719,7 +715,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -719,7 +715,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that attempts to copy the username via the context menu item provide // Checks that attempts to copy the username via the context menu item provide
...@@ -759,7 +754,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -759,7 +754,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that attempts to copy the password via the context menu item provide // Checks that attempts to copy the password via the context menu item provide
...@@ -806,7 +800,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -806,7 +800,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that attempts to show and hide the password via the context menu item // Checks that attempts to show and hide the password via the context menu item
...@@ -861,7 +854,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -861,7 +854,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks that federated credentials have no password but show the federation. // Checks that federated credentials have no password but show the federation.
...@@ -906,7 +898,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -906,7 +898,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks the order of the elements in the detail view layout for a // Checks the order of the elements in the detail view layout for a
...@@ -963,7 +954,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -963,7 +954,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks the order of the elements in the detail view layout for a blacklisted // Checks the order of the elements in the detail view layout for a blacklisted
...@@ -1009,7 +999,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -1009,7 +999,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Checks the order of the elements in the detail view layout for a federated // Checks the order of the elements in the detail view layout for a federated
...@@ -1068,7 +1057,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -1068,7 +1057,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Check that stored entries are shown no matter what the preference for saving // Check that stored entries are shown no matter what the preference for saving
...@@ -1109,7 +1097,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -1109,7 +1097,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
TapDone(); TapDone();
ClearPasswordStore();
} }
// Check that toggling the switch for the "save passwords" preference changes // Check that toggling the switch for the "save passwords" preference changes
......
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