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

Unified Diff: chrome/browser/sync/test/integration/passwords_helper.cc

Issue 335893002: Support to remove passwords by date_synced timestamp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync integration tests Created 6 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: chrome/browser/sync/test/integration/passwords_helper.cc
diff --git a/chrome/browser/sync/test/integration/passwords_helper.cc b/chrome/browser/sync/test/integration/passwords_helper.cc
index 6a3fb0fe7af79225d16e0fa4f175f0ac6f3d3acf..2b1833c91edcbe133bf98dce5de46057f956940e 100644
--- a/chrome/browser/sync/test/integration/passwords_helper.cc
+++ b/chrome/browser/sync/test/integration/passwords_helper.cc
@@ -64,6 +64,15 @@ class PasswordStoreConsumerHelper
DISALLOW_COPY_AND_ASSIGN(PasswordStoreConsumerHelper);
};
+// PasswordForm::date_synced is a local field. Therefore it may be different
+// across clients.
+void ClearSyncDateField(std::vector<PasswordForm>* forms) {
+ for (std::vector<PasswordForm>::iterator it = forms->begin();
+ it != forms->end(); ++it) {
+ it->date_synced = base::Time();
+ }
+}
+
} // namespace
namespace passwords_helper {
@@ -137,6 +146,7 @@ bool ProfileContainsSamePasswordFormsAsVerifier(int index) {
std::vector<PasswordForm> forms;
GetLogins(GetVerifierPasswordStore(), verifier_forms);
GetLogins(GetPasswordStore(index), forms);
+ ClearSyncDateField(&forms);
bool result =
password_manager::ContainsSamePasswordForms(verifier_forms, forms);
if (!result) {
@@ -159,6 +169,8 @@ bool ProfilesContainSamePasswordForms(int index_a, int index_b) {
std::vector<PasswordForm> forms_b;
GetLogins(GetPasswordStore(index_a), forms_a);
GetLogins(GetPasswordStore(index_b), forms_b);
+ ClearSyncDateField(&forms_a);
+ ClearSyncDateField(&forms_b);
bool result = password_manager::ContainsSamePasswordForms(forms_a, forms_b);
if (!result) {
LOG(ERROR) << "Password forms in Profile" << index_a << ":";

Powered by Google App Engine
This is Rietveld 408576698