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

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

Issue 283563002: Password Login Database: report correct changes from AddLogin(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed PasswordSyncableServiceTest.PasswordStoreChanges 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: components/password_manager/core/browser/password_syncable_service_unittest.cc
diff --git a/components/password_manager/core/browser/password_syncable_service_unittest.cc b/components/password_manager/core/browser/password_syncable_service_unittest.cc
index ce7866924082ec7467f89922b73be5aa1de3afc1..b64dcb4b1ad4bcf37b2f5541850d1c19f6e93e35 100644
--- a/components/password_manager/core/browser/password_syncable_service_unittest.cc
+++ b/components/password_manager/core/browser/password_syncable_service_unittest.cc
@@ -238,10 +238,8 @@ SyncError PasswordStoreDataVerifier::TestSyncChanges(
const SyncChangeList& change_list) {
for (SyncChangeList::const_iterator it = change_list.begin();
it != change_list.end(); ++it) {
- const SyncChange& data = *it;
- const sync_pb::PasswordSpecificsData& actual_password(
- GetPasswordSpecifics(data.sync_data()));
- std::string actual_tag = MakePasswordSyncTag(actual_password);
+ SyncData data = it->sync_data();
+ std::string actual_tag = syncer::SyncDataLocal(data).GetTag();
bool matched = false;
for (SyncChangeList::iterator expected_it =
@@ -251,9 +249,10 @@ SyncError PasswordStoreDataVerifier::TestSyncChanges(
const sync_pb::PasswordSpecificsData& expected_password(
GetPasswordSpecifics(expected_it->sync_data()));
if (actual_tag == MakePasswordSyncTag(expected_password)) {
- PasswordsEqual(expected_password, actual_password);
- EXPECT_EQ(expected_it->change_type(), data.change_type());
+ EXPECT_EQ(expected_it->change_type(), it->change_type());
matched = true;
+ if (it->change_type() != SyncChange::ACTION_DELETE)
+ PasswordsEqual(expected_password, GetPasswordSpecifics(data));
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698