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

Unified Diff: components/autofill/core/browser/personal_data_manager_unittest.cc

Issue 347183005: autofill names - dont parse when calling SetRawInfo(FULL_NAME) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android test expectation Created 6 years, 5 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/personal_data_manager_unittest.cc
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
index bdbe43656c4d381ac51e9bcd477d9c8abcaa7b80..942be39bf2a685cedcee560b21bda43a14026397 100644
--- a/components/autofill/core/browser/personal_data_manager_unittest.cc
+++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -1097,13 +1097,17 @@ TEST_F(PersonalDataManagerTest, AggregateTwoProfilesWithMultiValue) {
const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles();
// Modify expected to include multi-valued fields.
- std::vector<base::string16> values;
- expected.GetRawMultiInfo(NAME_FULL, &values);
- values.push_back(ASCIIToUTF16("John Adams"));
- expected.SetRawMultiInfo(NAME_FULL, values);
- expected.GetRawMultiInfo(EMAIL_ADDRESS, &values);
- values.push_back(ASCIIToUTF16("second@gmail.com"));
- expected.SetRawMultiInfo(EMAIL_ADDRESS, values);
+ std::vector<base::string16> first_names, last_names, emails;
+ expected.GetRawMultiInfo(NAME_FIRST, &first_names);
+ first_names.push_back(ASCIIToUTF16("John"));
+ expected.GetRawMultiInfo(NAME_LAST, &last_names);
+ last_names.push_back(ASCIIToUTF16("Adams"));
+ expected.SetRawMultiInfo(NAME_FIRST, first_names);
+ expected.SetRawMultiInfo(NAME_LAST, last_names);
+
+ expected.GetRawMultiInfo(EMAIL_ADDRESS, &emails);
+ emails.push_back(ASCIIToUTF16("second@gmail.com"));
+ expected.SetRawMultiInfo(EMAIL_ADDRESS, emails);
ASSERT_EQ(1U, results2.size());
EXPECT_EQ(0, expected.Compare(*results2[0]));
@@ -2119,10 +2123,16 @@ TEST_F(PersonalDataManagerTest, SaveImportedProfileWithExistingVerifiedData) {
// The new profile should be merged into the existing one.
AutofillProfile expected_profile = new_verified_profile;
expected_profile.set_guid(profile.guid());
- std::vector<base::string16> names;
- expected_profile.GetRawMultiInfo(NAME_FULL, &names);
- names.insert(names.begin(), ASCIIToUTF16("Marion Mitchell Morrison"));
- expected_profile.SetRawMultiInfo(NAME_FULL, names);
+ std::vector<base::string16> first_names, middle_names, last_names;
+ expected_profile.GetRawMultiInfo(NAME_FIRST, &first_names);
+ expected_profile.GetRawMultiInfo(NAME_MIDDLE, &middle_names);
+ expected_profile.GetRawMultiInfo(NAME_LAST, &last_names);
+ first_names.insert(first_names.begin(), ASCIIToUTF16("Marion"));
+ middle_names.insert(middle_names.begin(), ASCIIToUTF16("Mitchell"));
+ last_names.insert(last_names.begin(), ASCIIToUTF16("Morrison"));
+ expected_profile.SetRawMultiInfo(NAME_FIRST, first_names);
+ expected_profile.SetRawMultiInfo(NAME_MIDDLE, middle_names);
+ expected_profile.SetRawMultiInfo(NAME_LAST, last_names);
const std::vector<AutofillProfile*>& results = personal_data_->GetProfiles();
ASSERT_EQ(1U, results.size());

Powered by Google App Engine
This is Rietveld 408576698