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

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

Issue 2263683002: credentials_to_update should own its PasswordForms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621355_dont_set_preferred
Patch Set: No empty->null Created 4 years, 4 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_form_manager_unittest.cc
diff --git a/components/password_manager/core/browser/password_form_manager_unittest.cc b/components/password_manager/core/browser/password_form_manager_unittest.cc
index 06635d5c602af5823e3cdb3230866442bdeefe87..f7f157f3093baf891c3c9819e0a4ad1f598cc2f8 100644
--- a/components/password_manager/core/browser/password_form_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -76,12 +76,12 @@ class MockFormSaver : public StubFormSaver {
void(const autofill::PasswordForm& pending,
const autofill::PasswordFormMap& best_matches,
const autofill::PasswordForm* old_primary_key));
- MOCK_METHOD4(Update,
- void(const autofill::PasswordForm& pending,
- const autofill::PasswordFormMap& best_matches,
- const std::vector<const autofill::PasswordForm*>*
- credentials_to_update,
- const autofill::PasswordForm* old_primary_key));
+ MOCK_METHOD4(
+ Update,
+ void(const autofill::PasswordForm& pending,
+ const autofill::PasswordFormMap& best_matches,
+ const std::vector<autofill::PasswordForm>* credentials_to_update,
+ const autofill::PasswordForm* old_primary_key));
MOCK_METHOD3(WipeOutdatedCopies,
void(const autofill::PasswordForm& pending,
autofill::PasswordFormMap* best_matches,
@@ -2432,7 +2432,7 @@ TEST_F(PasswordFormManagerTest, TestUpdatePSLMatchedCredentials) {
// Trigger saving to exercise some special case handling during updating.
PasswordForm new_credentials;
- std::vector<const autofill::PasswordForm*> credentials_to_update;
+ std::vector<autofill::PasswordForm> credentials_to_update;
EXPECT_CALL(MockFormSaver::Get(&form_manager), Update(_, _, _, nullptr))
.WillOnce(testing::DoAll(SaveArg<0>(&new_credentials),
SaveArgPointee<2>(&credentials_to_update)));
@@ -2451,14 +2451,14 @@ TEST_F(PasswordFormManagerTest, TestUpdatePSLMatchedCredentials) {
ASSERT_EQ(1u, credentials_to_update.size());
EXPECT_EQ(credentials.password_value,
- credentials_to_update[0]->password_value);
+ credentials_to_update[0].password_value);
EXPECT_EQ(psl_saved_match()->username_element,
- credentials_to_update[0]->username_element);
+ credentials_to_update[0].username_element);
EXPECT_EQ(psl_saved_match()->username_element,
- credentials_to_update[0]->username_element);
+ credentials_to_update[0].username_element);
EXPECT_EQ(psl_saved_match()->password_element,
- credentials_to_update[0]->password_element);
- EXPECT_EQ(psl_saved_match()->origin, credentials_to_update[0]->origin);
+ credentials_to_update[0].password_element);
+ EXPECT_EQ(psl_saved_match()->origin, credentials_to_update[0].origin);
}
TEST_F(PasswordFormManagerTest,

Powered by Google App Engine
This is Rietveld 408576698