Commit 873f3998 authored by Jan Wilken Dörrie's avatar Jan Wilken Dörrie Committed by Commit Bot

[Passwords] AccountStoreMatchesContainForm considers password_value

This change adds a test that the MultiStorePasswordSaveManager does not
short circuit in MoveCredentialsToAccountStore in case the
password_value of the to be moved form differs from an otherwise equal
form in the account store.

Bug: None
Change-Id: Ia0d8a0ddde77fc9055f87aadd8b33b42949a62b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2529392Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826224}
parent 64fef129
......@@ -904,6 +904,30 @@ TEST_F(MultiStorePasswordSaveManagerTest,
password_save_manager()->MoveCredentialsToAccountStore(kTrigger);
}
TEST_F(
MultiStorePasswordSaveManagerTest,
MoveCredentialsFromProfileToAccountStoreWhenExistsInBothStoresWithDifferentPassword) {
PasswordForm saved_match_in_profile_store(saved_match_);
saved_match_in_profile_store.in_store = PasswordForm::Store::kProfileStore;
saved_match_in_profile_store.password_value = ASCIIToUTF16("password1");
PasswordForm saved_match_in_account_store(saved_match_);
saved_match_in_account_store.in_store = PasswordForm::Store::kAccountStore;
saved_match_in_account_store.password_value = ASCIIToUTF16("password2");
SetNonFederatedAndNotifyFetchCompleted(
{&saved_match_in_profile_store, &saved_match_in_account_store});
password_save_manager()->CreatePendingCredentials(
saved_match_in_profile_store, &observed_form_, submitted_form_,
/*is_http_auth=*/false,
/*is_credential_api_save=*/false);
EXPECT_CALL(*mock_profile_form_saver(), Remove(saved_match_in_profile_store));
EXPECT_CALL(*mock_account_form_saver(),
Save(saved_match_in_profile_store, _, _));
password_save_manager()->MoveCredentialsToAccountStore(kTrigger);
}
TEST_F(MultiStorePasswordSaveManagerTest,
MoveCredentialsFromProfileToAccountStoreWhenPSLMatchExistsInBothStores) {
PasswordForm saved_match_in_profile_store(saved_match_);
......
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