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 << ":"; |