Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: components/password_manager/core/browser/password_manager_unittest.cc

Issue 2098573002: Implement PasswordFormManager::WipeStoreCopyIfOutdated in FormSaver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621355_FormSaver
Patch Set: Just rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/password_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc
index 677643d25621cc5722ed026e4f458e4d52b4369a..3fe98f2050bb656b7f39ff8223409bc8d9a13b0d 100644
--- a/components/password_manager/core/browser/password_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -176,6 +176,13 @@ class PasswordManagerTest : public testing::Test {
return form;
}
+ PasswordForm MakeSimpleGAIAForm() {
+ PasswordForm form = MakeSimpleForm();
+ form.origin = GURL("https://accounts.google.com");
+ form.signon_realm = form.origin.spec();
+ return form;
+ }
+
// Create a sign-up form that only has a new password field.
PasswordForm MakeFormWithOnlyNewPasswordField() {
PasswordForm form = MakeSimpleForm();
@@ -578,7 +585,7 @@ TEST_F(PasswordManagerTest, PasswordFormReappearance) {
TEST_F(PasswordManagerTest, SyncCredentialsNotSaved) {
// Simulate loading a simple form with no existing stored password.
std::vector<PasswordForm> observed;
- PasswordForm form(MakeSimpleForm());
+ PasswordForm form(MakeSimpleGAIAForm());
observed.push_back(form);
EXPECT_CALL(*store_, GetLogins(_, _))
.WillRepeatedly(WithArg<1>(InvokeEmptyConsumerWithForms()));
@@ -604,7 +611,7 @@ TEST_F(PasswordManagerTest, SyncCredentialsNotSaved) {
// When there is a sync password saved, and the user successfully uses the
// stored version of it, PasswordManager should not drop that password.
TEST_F(PasswordManagerTest, SyncCredentialsNotDroppedIfUpToDate) {
- PasswordForm form(MakeSimpleForm());
+ PasswordForm form(MakeSimpleGAIAForm());
EXPECT_CALL(*store_, GetLogins(_, _))
.WillRepeatedly(WithArg<1>(InvokeConsumer(form)));
@@ -634,7 +641,7 @@ TEST_F(PasswordManagerTest, SyncCredentialsNotDroppedIfUpToDate) {
// updated version of it, the obsolete one should be dropped, to avoid filling
// it later.
TEST_F(PasswordManagerTest, SyncCredentialsDroppedWhenObsolete) {
- PasswordForm form(MakeSimpleForm());
+ PasswordForm form(MakeSimpleGAIAForm());
form.password_value = ASCIIToUTF16("old pa55word");
// Pretend that the password store contains "old pa55word" stored for |form|.
EXPECT_CALL(*store_, GetLogins(_, _))

Powered by Google App Engine
This is Rietveld 408576698