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

Unified Diff: components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc

Issue 1891903002: [Autofill] Set basic information when adding a new profiles and credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc
diff --git a/components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc b/components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc
index 352074e0eb00506a6cc5ac792656cb2f7eae656d..f47ad8eb9846e02d8e883420b324e33f4b0b281a 100644
--- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc
+++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc
@@ -449,6 +449,8 @@ TEST_F(AutofillProfileSyncableServiceTest, MergeDataEmptyOrigins) {
autofill_specifics->add_email_address(std::string());
autofill_specifics->add_phone_home_whole_number(std::string());
autofill_specifics->set_address_home_line1("1 1st st");
+ autofill_specifics->set_use_count(profile.use_count());
+ autofill_specifics->set_use_date(profile.use_date().ToTimeT());
EXPECT_FALSE(autofill_specifics->has_origin());
syncer::SyncDataList data_list;
@@ -780,6 +782,8 @@ TEST_F(AutofillProfileSyncableServiceTest, MergeDataEmptyStreetAddress) {
autofill_specifics->add_phone_home_whole_number(std::string());
autofill_specifics->set_address_home_line1("123 Example St.");
autofill_specifics->set_address_home_line2("Apt. 42");
+ autofill_specifics->set_use_count(profile.use_count());
+ autofill_specifics->set_use_date(profile.use_date().ToTimeT());
EXPECT_FALSE(autofill_specifics->has_address_home_street_address());
syncer::SyncDataList data_list;
@@ -856,6 +860,8 @@ TEST_F(AutofillProfileSyncableServiceTest, NoLanguageCodeNoSync) {
autofill_specifics->add_name_full(std::string());
autofill_specifics->add_email_address(std::string());
autofill_specifics->add_phone_home_whole_number(std::string());
+ autofill_specifics->set_use_count(profile.use_count());
+ autofill_specifics->set_use_date(profile.use_date().ToTimeT());
EXPECT_FALSE(autofill_specifics->has_address_home_language_code());
syncer::SyncDataList data_list;
@@ -1042,6 +1048,8 @@ TEST_F(AutofillProfileSyncableServiceTest, NoFullNameNoSync) {
autofill_specifics->add_name_middle(std::string());
autofill_specifics->add_name_last(std::string());
autofill_specifics->add_email_address(std::string());
+ autofill_specifics->set_use_count(profile.use_count());
+ autofill_specifics->set_use_date(profile.use_date().ToTimeT());
autofill_specifics->add_phone_home_whole_number(std::string());
syncer::SyncDataList data_list;
@@ -1104,6 +1112,8 @@ TEST_F(AutofillProfileSyncableServiceTest, NoUsageStatsNoSync) {
// Local autofill profile has 0 for use_count/use_date.
AutofillProfile profile(kGuid1, kHttpsOrigin);
profile.set_language_code("en");
+ profile.set_use_count(0);
+ profile.set_use_date(base::Time());
EXPECT_EQ(0U, profile.use_count());
EXPECT_EQ(base::Time(), profile.use_date());
profiles_from_web_db.push_back(new AutofillProfile(profile));
@@ -1145,6 +1155,8 @@ TEST_F(AutofillProfileSyncableServiceTest, SyncUpdatesEmptyUsageStats) {
// Local autofill profile has 0 for use_count/use_date.
AutofillProfile profile(kGuid1, kHttpsOrigin);
profile.set_language_code("en");
+ profile.set_use_count(0);
+ profile.set_use_date(base::Time());
EXPECT_EQ(0U, profile.use_count());
EXPECT_EQ(base::Time(), profile.use_date());
profiles_from_web_db.push_back(new AutofillProfile(profile));

Powered by Google App Engine
This is Rietveld 408576698