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

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

Issue 2262843002: Make PasswordFormManager::best_matches_ const (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621355_pass_creds_to_update_by_value
Patch Set: Just rebased 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 bc1e992fa7783841ae35377141ff7656e2ba857b..d90c6b9d197dd007ec11a93db84fdb56c21172d4 100644
--- a/components/password_manager/core/browser/password_form_manager_unittest.cc
+++ b/components/password_manager/core/browser/password_form_manager_unittest.cc
@@ -72,19 +72,20 @@ class MockFormSaver : public StubFormSaver {
// FormSaver:
MOCK_METHOD1(PermanentlyBlacklist, void(autofill::PasswordForm* observed));
- MOCK_METHOD3(Save,
- void(const autofill::PasswordForm& pending,
- const autofill::PasswordFormMap& best_matches,
- const autofill::PasswordForm* old_primary_key));
+ MOCK_METHOD3(
+ Save,
+ void(const autofill::PasswordForm& pending,
+ const std::map<base::string16, const PasswordForm*>& best_matches,
+ const autofill::PasswordForm* old_primary_key));
MOCK_METHOD4(
Update,
void(const autofill::PasswordForm& pending,
- const autofill::PasswordFormMap& best_matches,
+ const std::map<base::string16, const PasswordForm*>& 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,
+ std::map<base::string16, const PasswordForm*>* best_matches,
const autofill::PasswordForm** preferred_match));
// Convenience downcasting method.
@@ -1363,7 +1364,7 @@ TEST_F(PasswordFormManagerTest, TestBestCredentialsByEachUsernameAreIncluded) {
.WillOnce(SaveArg<0>(&fill_data));
form_manager()->OnGetPasswordStoreResults(std::move(simulated_results));
- const autofill::PasswordFormMap& best_matches =
+ const std::map<base::string16, const PasswordForm*>& best_matches =
form_manager()->best_matches();
EXPECT_EQ(3u, best_matches.size());
EXPECT_NE(best_matches.end(),
@@ -1957,7 +1958,7 @@ TEST_F(PasswordFormManagerTest, PreferredMatchIsUpToDate) {
form_manager()->OnGetPasswordStoreResults(std::move(simulated_results));
EXPECT_EQ(1u, form_manager()->best_matches().size());
EXPECT_EQ(form_manager()->preferred_match(),
- form_manager()->best_matches().begin()->second.get());
+ form_manager()->best_matches().begin()->second);
// Make sure to access all fields of preferred_match; this way if it was
// deleted, ASAN might notice it.
PasswordForm dummy(*form_manager()->preferred_match());

Powered by Google App Engine
This is Rietveld 408576698