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

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

Issue 1162203004: [Autofill] More variant-related code deletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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/autofill/core/browser/autofill_profile.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7e8134d49da05cd1bdddcd25d66f4d0d6c5a5524..15620c4074369a88198ecebab8021f4fe0f218e1 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
@@ -141,15 +141,10 @@ scoped_ptr<AutofillProfile> ConstructCompleteProfile() {
profile->SetRawInfo(NAME_MIDDLE, ASCIIToUTF16("K."));
profile->SetRawInfo(NAME_LAST, ASCIIToUTF16("Doe"));
- std::vector<base::string16> emails;
- emails.push_back(ASCIIToUTF16("user@example.com"));
- emails.push_back(ASCIIToUTF16("superuser@example.org"));
- profile->SetRawMultiInfo(EMAIL_ADDRESS, emails);
-
- std::vector<base::string16> phones;
- phones.push_back(ASCIIToUTF16("1.800.555.1234"));
- phones.push_back(ASCIIToUTF16("1.866.650.0000"));
- profile->SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, phones);
+ profile->SetRawInfo(EMAIL_ADDRESS,
+ ASCIIToUTF16("user@example.com"));
+ profile->SetRawInfo(PHONE_HOME_WHOLE_NUMBER,
+ ASCIIToUTF16("1.800.555.1234"));
profile->SetRawInfo(ADDRESS_HOME_STREET_ADDRESS,
ASCIIToUTF16("123 Fake St.\n"
@@ -188,10 +183,8 @@ syncer::SyncData ConstructCompleteSyncData() {
specifics->add_name_full("John K. Doe, Jr.");
specifics->add_email_address("user@example.com");
- specifics->add_email_address("superuser@example.org");
specifics->add_phone_home_whole_number("1.800.555.1234");
- specifics->add_phone_home_whole_number("1.866.650.0000");
specifics->set_address_home_line1("123 Fake St.");
specifics->set_address_home_line2("Apt. 42");
@@ -597,39 +590,6 @@ TEST_F(AutofillProfileSyncableServiceTest, UpdateField) {
EXPECT_EQ(profile.GetRawInfo(COMPANY_NAME), ASCIIToUTF16(company2));
}
-TEST_F(AutofillProfileSyncableServiceTest, UpdateMultivaluedField) {
- AutofillProfile profile(kGuid1, kHttpsOrigin);
-
- std::vector<base::string16> values;
- values.push_back(ASCIIToUTF16("1@1.com"));
- values.push_back(ASCIIToUTF16("2@1.com"));
- profile.SetRawMultiInfo(EMAIL_ADDRESS, values);
-
- ::google::protobuf::RepeatedPtrField<std::string> specifics_fields;
- specifics_fields.AddAllocated(new std::string("2@1.com"));
- specifics_fields.AddAllocated(new std::string("3@1.com"));
-
- EXPECT_TRUE(AutofillProfileSyncableService::UpdateMultivaluedField(
- EMAIL_ADDRESS, specifics_fields, &profile));
- profile.GetRawMultiInfo(EMAIL_ADDRESS, &values);
- ASSERT_TRUE(values.size() == 2);
- EXPECT_EQ(values[0], ASCIIToUTF16("2@1.com"));
- EXPECT_EQ(values[1], ASCIIToUTF16("3@1.com"));
-
- EXPECT_FALSE(AutofillProfileSyncableService::UpdateMultivaluedField(
- EMAIL_ADDRESS, specifics_fields, &profile));
- profile.GetRawMultiInfo(EMAIL_ADDRESS, &values);
- ASSERT_EQ(values.size(), 2U);
- EXPECT_EQ(values[0], ASCIIToUTF16("2@1.com"));
- EXPECT_EQ(values[1], ASCIIToUTF16("3@1.com"));
- EXPECT_TRUE(AutofillProfileSyncableService::UpdateMultivaluedField(
- EMAIL_ADDRESS, ::google::protobuf::RepeatedPtrField<std::string>(),
- &profile));
- profile.GetRawMultiInfo(EMAIL_ADDRESS, &values);
- ASSERT_EQ(values.size(), 1U); // Always have at least an empty string.
- EXPECT_EQ(values[0], ASCIIToUTF16(""));
-}
-
TEST_F(AutofillProfileSyncableServiceTest, MergeProfile) {
AutofillProfile profile1(kGuid1, kHttpOrigin);
profile1.SetRawInfo(ADDRESS_HOME_LINE1, ASCIIToUTF16("111 First St."));
« no previous file with comments | « components/autofill/core/browser/autofill_profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698