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

Unified Diff: chrome/browser/password_manager/password_store_x_unittest.cc

Issue 299443002: Password Login Database: report correct changes from UpdateLogin(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respect primary key in the UpdateLogin() Created 6 years, 7 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: chrome/browser/password_manager/password_store_x_unittest.cc
diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc
index 59c4ca57cb01425ebca6c51cef8e77015916a68d..3882ba03295e87160b6f515f78172946a8b28e30 100644
--- a/chrome/browser/password_manager/password_store_x_unittest.cc
+++ b/chrome/browser/password_manager/password_store_x_unittest.cc
@@ -62,7 +62,10 @@ class FailingBackend : public PasswordStoreX::NativeBackend {
virtual PasswordStoreChangeList AddLogin(const PasswordForm& form) OVERRIDE {
return PasswordStoreChangeList();
}
- virtual bool UpdateLogin(const PasswordForm& form) OVERRIDE { return false; }
+ virtual bool UpdateLogin(const PasswordForm& form,
+ PasswordStoreChangeList* changes) OVERRIDE {
+ return false;
+ }
virtual bool RemoveLogin(const PasswordForm& form) OVERRIDE { return false; }
virtual bool RemoveLoginsCreatedBetween(
@@ -100,10 +103,14 @@ class MockBackend : public PasswordStoreX::NativeBackend {
return PasswordStoreChangeList(1, change);
}
- virtual bool UpdateLogin(const PasswordForm& form) OVERRIDE {
+ virtual bool UpdateLogin(const PasswordForm& form,
+ PasswordStoreChangeList* changes) OVERRIDE {
for (size_t i = 0; i < all_forms_.size(); ++i)
- if (CompareForms(all_forms_[i], form, true))
+ if (CompareForms(all_forms_[i], form, true)) {
all_forms_[i] = form;
+ changes->push_back(PasswordStoreChange(PasswordStoreChange::UPDATE,
+ form));
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698