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

Unified Diff: chrome/browser/autofill/autofill_profile_unittest.cc

Issue 8038064: Autofill: Support 'full names' that are lacking a first or a middle name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 9 years, 3 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 | « no previous file | chrome/browser/autofill/contact_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_profile_unittest.cc
diff --git a/chrome/browser/autofill/autofill_profile_unittest.cc b/chrome/browser/autofill/autofill_profile_unittest.cc
index cb63d503a1f7a9ecb90a5a858cd49d0491585f29..2cfe340be8d220ee3cd774f7d2dd9f9438a1d247 100644
--- a/chrome/browser/autofill/autofill_profile_unittest.cc
+++ b/chrome/browser/autofill/autofill_profile_unittest.cc
@@ -39,7 +39,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
// Case 0a/empty name and address, so the first two fields of the rest of the
// data is used: "Hollywood, CA"
AutofillProfile profile00;
- autofill_test::SetProfileInfo(&profile00, "", "Mitchell", "",
+ autofill_test::SetProfileInfo(&profile00, "", "", "",
"johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US",
"16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile00));
@@ -48,7 +48,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
// Case 1: "<address>" without line 2.
AutofillProfile profile1;
- autofill_test::SetProfileInfo(&profile1, "", "Mitchell", "",
+ autofill_test::SetProfileInfo(&profile1, "", "", "",
"johnwayne@me.xyz", "Fox", "123 Zoo St.", "", "Hollywood", "CA",
"91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile1));
@@ -57,7 +57,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
// Case 1a: "<address>" with line 2.
AutofillProfile profile1a;
- autofill_test::SetProfileInfo(&profile1a, "", "Mitchell", "",
+ autofill_test::SetProfileInfo(&profile1a, "", "", "",
"johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA",
"91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile1a));
@@ -71,8 +71,8 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
"91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile2));
string16 summary2 = profile2.Label();
- // Summary does include full name which is empty if the first name is empty.
- EXPECT_EQ(ASCIIToUTF16("Hollywood, CA"), summary2);
+ // Summary includes full name, to the maximal extent available.
+ EXPECT_EQ(ASCIIToUTF16("Mitchell Morrison, Hollywood"), summary2);
// Case 3: "<lastname>, <address>"
AutofillProfile profile3;
@@ -81,7 +81,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
"Hollywood", "CA", "91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile3));
string16 summary3 = profile3.Label();
- EXPECT_EQ(ASCIIToUTF16("123 Zoo St., Hollywood"), summary3);
+ EXPECT_EQ(ASCIIToUTF16("Mitchell Morrison, 123 Zoo St."), summary3);
// Case 4: "<firstname>"
AutofillProfile profile4;
« no previous file with comments | « no previous file | chrome/browser/autofill/contact_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698