Commit 45f0132c authored by Vaclav Brozek's avatar Vaclav Brozek Committed by Commit Bot

Clean-up methods in PasswordsSettingsTestCase

PasswordsSettingsTestCase exposes a number of instance methods to do
instance-independent work. Those should either become class methods or
functions in the anonymous namespace.

Those methods are not related to the PasswordsSettingsTestCase class either,
and there already are helper functions in the anonymous namespace in
passwords_settings_egtest.mm. Therefore this CL moves the mentioned methods to
become functions in the anonymous namespace.

Bug: 744058
Change-Id: I1f8ede1d5bb4ef950f701cdefe407dc2d3bac0dd
Reviewed-on: https://chromium-review.googlesource.com/573025
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@{#488176}
parent dae2657e
...@@ -210,6 +210,64 @@ id<GREYMatcher> PopUpMenuItemWithLabel(int label) { ...@@ -210,6 +210,64 @@ id<GREYMatcher> PopUpMenuItemWithLabel(int label) {
nullptr); nullptr);
} }
scoped_refptr<password_manager::PasswordStore> GetPasswordStore() {
// ServiceAccessType governs behaviour in Incognito: only modifications with
// EXPLICIT_ACCESS, which correspond to user's explicit gesture, succeed.
// This test does not deal with Incognito, so the value of the argument is
// irrelevant.
return IOSChromePasswordStoreFactory::GetForBrowserState(
chrome_test_util::GetOriginalBrowserState(),
ServiceAccessType::EXPLICIT_ACCESS);
}
// Saves |form| to the password store and waits until the async processing is
// done.
void SaveToPasswordStore(const PasswordForm& form) {
GetPasswordStore()->AddLogin(form);
// Allow the PasswordStore to process this on the DB thread.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
}
// Saves an example form in the store.
void SaveExamplePasswordForm() {
PasswordForm example;
example.username_value = base::ASCIIToUTF16("concrete username");
example.password_value = base::ASCIIToUTF16("concrete password");
example.origin = GURL("https://example.com");
example.signon_realm = example.origin.spec();
SaveToPasswordStore(example);
}
// Removes all credentials stored.
void ClearPasswordStore() {
GetPasswordStore()->RemoveLoginsCreatedBetween(base::Time(), base::Time(),
base::Closure());
// Allow the PasswordStore to process this on the DB thread.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
}
// Opens the passwords page from the NTP. It requires no menus to be open.
void OpenPasswordSettings() {
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI
tapSettingsMenuButton:chrome_test_util::SettingsMenuPasswordsButton()];
}
// Tap Edit in any settings view.
void TapEdit() {
[[EarlGrey
selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId(
IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON)]
performAction:grey_tap()];
}
// Tap Done in any settings view.
void TapDone() {
[[EarlGrey
selectElementWithMatcher:chrome_test_util::NavigationBarDoneButton()]
performAction:grey_tap()];
}
} // namespace } // namespace
@interface MockReauthenticationModule : NSObject<ReauthenticationProtocol> @interface MockReauthenticationModule : NSObject<ReauthenticationProtocol>
...@@ -271,64 +329,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -271,64 +329,6 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[super tearDown]; [super tearDown];
} }
- (scoped_refptr<password_manager::PasswordStore>)passwordStore {
// ServiceAccessType governs behaviour in Incognito: only modifications with
// EXPLICIT_ACCESS, which correspond to user's explicit gesture, succeed.
// This test does not deal with Incognito, so the value of the argument is
// irrelevant.
return IOSChromePasswordStoreFactory::GetForBrowserState(
chrome_test_util::GetOriginalBrowserState(),
ServiceAccessType::EXPLICIT_ACCESS);
}
// Saves |form| to the password store and waits until the async processing is
// done.
- (void)savePasswordFormToStore:(const PasswordForm&)form {
[self passwordStore]->AddLogin(form);
// Allow the PasswordStore to process this on the DB thread.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
}
// Saves an example form in the store.
- (void)saveExamplePasswordForm {
PasswordForm example;
example.username_value = base::ASCIIToUTF16("concrete username");
example.password_value = base::ASCIIToUTF16("concrete password");
example.origin = GURL("https://example.com");
example.signon_realm = example.origin.spec();
[self savePasswordFormToStore:example];
}
// Removes all credentials stored.
- (void)clearPasswordStore {
[self passwordStore]->RemoveLoginsCreatedBetween(base::Time(), base::Time(),
base::Closure());
// Allow the PasswordStore to process this on the DB thread.
[[GREYUIThreadExecutor sharedInstance] drainUntilIdle];
}
// Opens the passwords page from the NTP. It requires no menus to be open.
- (void)openPasswordSettings {
[ChromeEarlGreyUI openSettingsMenu];
[ChromeEarlGreyUI
tapSettingsMenuButton:chrome_test_util::SettingsMenuPasswordsButton()];
}
// Tap Edit in any settings view.
- (void)tapEdit {
[[EarlGrey
selectElementWithMatcher:chrome_test_util::ButtonWithAccessibilityLabelId(
IDS_IOS_NAVIGATION_BAR_EDIT_BUTTON)]
performAction:grey_tap()];
}
// Tap Done in any settings view.
- (void)tapDone {
[[EarlGrey
selectElementWithMatcher:chrome_test_util::NavigationBarDoneButton()]
performAction:grey_tap()];
}
// Verifies the UI elements are accessible on the Passwords page. // Verifies the UI elements are accessible on the Passwords page.
// TODO(crbug.com/159166): This differs from testAccessibilityOnPasswords in // TODO(crbug.com/159166): This differs from testAccessibilityOnPasswords in
// settings_egtest.mm in that here this tests the new UI (for viewing // settings_egtest.mm in that here this tests the new UI (for viewing
...@@ -340,14 +340,14 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -340,14 +340,14 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Saving a form is needed for using the "password details" view. // Saving a form is needed for using the "password details" view.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
chrome_test_util::VerifyAccessibilityForCurrentScreen(); chrome_test_util::VerifyAccessibilityForCurrentScreen();
[self tapEdit]; TapEdit();
chrome_test_util::VerifyAccessibilityForCurrentScreen(); chrome_test_util::VerifyAccessibilityForCurrentScreen();
[self tapDone]; TapDone();
// Inspect "password details" view. // Inspect "password details" view.
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
...@@ -358,8 +358,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -358,8 +358,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; ClearPasswordStore();
} }
// Checks that attempts to copy a password provide appropriate feedback, // Checks that attempts to copy a password provide appropriate feedback,
...@@ -370,9 +370,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -370,9 +370,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Saving a form is needed for using the "password details" view. // Saving a form is needed for using the "password details" view.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -406,8 +406,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -406,8 +406,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; ClearPasswordStore();
} }
// Checks that attempts to copy a username provide appropriate feedback. // Checks that attempts to copy a username provide appropriate feedback.
...@@ -417,9 +417,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -417,9 +417,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Saving a form is needed for using the "password details" view. // Saving a form is needed for using the "password details" view.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -436,8 +436,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -436,8 +436,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; ClearPasswordStore();
} }
// Checks that attempts to copy a site URL provide appropriate feedback. // Checks that attempts to copy a site URL provide appropriate feedback.
...@@ -447,9 +447,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -447,9 +447,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Saving a form is needed for using the "password details" view. // Saving a form is needed for using the "password details" view.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -466,8 +466,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -466,8 +466,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -478,9 +478,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -478,9 +478,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Save form to be deleted later. // Save form to be deleted later.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -516,8 +516,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -516,8 +516,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; ClearPasswordStore();
} }
// Checks that deleting a password from password details can be cancelled. // Checks that deleting a password from password details can be cancelled.
...@@ -527,9 +527,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -527,9 +527,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Save form to be deleted later. // Save form to be deleted later.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -560,8 +560,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -560,8 +560,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -572,11 +572,11 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -572,11 +572,11 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Save a form to have something to tap on. // Save a form to have something to tap on.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[self tapEdit]; TapEdit();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -588,8 +588,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -588,8 +588,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -600,9 +600,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -600,9 +600,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Saving a form is needed for using the "password details" view. // Saving a form is needed for using the "password details" view.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -627,8 +627,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -627,8 +627,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -639,9 +639,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -639,9 +639,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Saving a form is needed for using the "password details" view. // Saving a form is needed for using the "password details" view.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -667,8 +667,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -667,8 +667,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -679,9 +679,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -679,9 +679,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Saving a form is needed for using the "password details" view. // Saving a form is needed for using the "password details" view.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -714,8 +714,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -714,8 +714,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -726,9 +726,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -726,9 +726,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
// Saving a form is needed for using the "password details" view. // Saving a form is needed for using the "password details" view.
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -769,8 +769,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -769,8 +769,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; ClearPasswordStore();
} }
// Checks that federated credentials have no password but show the federation. // Checks that federated credentials have no password but show the federation.
...@@ -785,9 +785,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -785,9 +785,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
federated.signon_realm = federated.origin.spec(); federated.signon_realm = federated.origin.spec();
federated.federation_origin = federated.federation_origin =
url::Origin(GURL("https://famous.provider.net")); url::Origin(GURL("https://famous.provider.net"));
[self savePasswordFormToStore:federated]; SaveToPasswordStore(federated);
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, federated username") [GetInteractionForPasswordEntry(@"example.com, federated username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -814,8 +814,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -814,8 +814,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -825,9 +825,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -825,9 +825,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
scoped_feature_list.InitAndEnableFeature( scoped_feature_list.InitAndEnableFeature(
password_manager::features::kViewPasswords); password_manager::features::kViewPasswords);
[self saveExamplePasswordForm]; SaveExamplePasswordForm();
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, concrete username") [GetInteractionForPasswordEntry(@"example.com, concrete username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -871,8 +871,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -871,8 +871,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -886,9 +886,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -886,9 +886,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
blacklisted.origin = GURL("https://example.com"); blacklisted.origin = GURL("https://example.com");
blacklisted.signon_realm = blacklisted.origin.spec(); blacklisted.signon_realm = blacklisted.origin.spec();
blacklisted.blacklisted_by_user = true; blacklisted.blacklisted_by_user = true;
[self savePasswordFormToStore:blacklisted]; SaveToPasswordStore(blacklisted);
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com") performAction:grey_tap()]; [GetInteractionForPasswordEntry(@"example.com") performAction:grey_tap()];
...@@ -917,8 +917,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -917,8 +917,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; 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
...@@ -934,9 +934,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -934,9 +934,9 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
federated.signon_realm = federated.origin.spec(); federated.signon_realm = federated.origin.spec();
federated.federation_origin = federated.federation_origin =
url::Origin(GURL("https://famous.provider.net")); url::Origin(GURL("https://famous.provider.net"));
[self savePasswordFormToStore:federated]; SaveToPasswordStore(federated);
[self openPasswordSettings]; OpenPasswordSettings();
[GetInteractionForPasswordEntry(@"example.com, federated username") [GetInteractionForPasswordEntry(@"example.com, federated username")
performAction:grey_tap()]; performAction:grey_tap()];
...@@ -976,8 +976,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() { ...@@ -976,8 +976,8 @@ MockReauthenticationModule* SetUpAndReturnMockReauthenticationModule() {
performAction:grey_tap()]; performAction:grey_tap()];
[[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()]
performAction:grey_tap()]; performAction:grey_tap()];
[self tapDone]; TapDone();
[self clearPasswordStore]; ClearPasswordStore();
} }
@end @end
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