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

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

Issue 316243002: Add date_synced to PasswordForm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +comment 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
« no previous file with comments | « components/password_manager/core/browser/login_database.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/login_database_unittest.cc
diff --git a/components/password_manager/core/browser/login_database_unittest.cc b/components/password_manager/core/browser/login_database_unittest.cc
index 89a6e271a4e27ffe77640affc2e99e7e968e153b..8cef06ea54c2cc25dc8fc1df28d16d2a7a9d781a 100644
--- a/components/password_manager/core/browser/login_database_unittest.cc
+++ b/components/password_manager/core/browser/login_database_unittest.cc
@@ -135,19 +135,21 @@ TEST_F(LoginDatabaseTest, Logins) {
form.times_used = 1;
form.form_data.name = ASCIIToUTF16("form_name");
form.form_data.method = ASCIIToUTF16("POST");
+ form.date_synced = base::Time::Now();
// Add it and make sure it is there and that all the fields were retrieved
// correctly.
EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
EXPECT_TRUE(db_.GetAutofillableLogins(&result));
- EXPECT_EQ(1U, result.size());
+ ASSERT_EQ(1U, result.size());
FormsAreEqual(form, *result[0]);
delete result[0];
result.clear();
// Match against an exact copy.
EXPECT_TRUE(db_.GetLogins(form, &result));
- EXPECT_EQ(1U, result.size());
+ ASSERT_EQ(1U, result.size());
+ FormsAreEqual(form, *result[0]);
delete result[0];
result.clear();
@@ -659,6 +661,7 @@ TEST_F(LoginDatabaseTest, BlacklistedLogins) {
form.preferred = true;
form.blacklisted_by_user = true;
form.scheme = PasswordForm::SCHEME_HTML;
+ form.date_synced = base::Time::Now();
EXPECT_EQ(AddChangeForForm(form), db_.AddLogin(form));
// Get all non-blacklisted logins (should be none).
@@ -667,12 +670,14 @@ TEST_F(LoginDatabaseTest, BlacklistedLogins) {
// GetLogins should give the blacklisted result.
EXPECT_TRUE(db_.GetLogins(form, &result));
- EXPECT_EQ(1U, result.size());
+ ASSERT_EQ(1U, result.size());
+ FormsAreEqual(form, *result[0]);
ClearResults(&result);
// So should GetAllBlacklistedLogins.
EXPECT_TRUE(db_.GetBlacklistLogins(&result));
- EXPECT_EQ(1U, result.size());
+ ASSERT_EQ(1U, result.size());
+ FormsAreEqual(form, *result[0]);
ClearResults(&result);
}
« no previous file with comments | « components/password_manager/core/browser/login_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698