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

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

Issue 7892048: Autofill: Remove fax number completely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment fix. 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 | « chrome/browser/autofill/autofill_profile.cc ('k') | chrome/browser/autofill/autofill_type.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 6c1297e612bef49c08429976f1bcc5bf46e47865..cb63d503a1f7a9ecb90a5a858cd49d0491585f29 100644
--- a/chrome/browser/autofill/autofill_profile_unittest.cc
+++ b/chrome/browser/autofill/autofill_profile_unittest.cc
@@ -41,7 +41,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile00;
autofill_test::SetProfileInfo(&profile00, "", "Mitchell", "",
"johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US",
- "16505678910", "78127654321");
+ "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile00));
string16 summary00 = profile00.Label();
EXPECT_EQ(ASCIIToUTF16("Hollywood, CA"), summary00);
@@ -50,7 +50,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile1;
autofill_test::SetProfileInfo(&profile1, "", "Mitchell", "",
"johnwayne@me.xyz", "Fox", "123 Zoo St.", "", "Hollywood", "CA",
- "91601", "US", "16505678910", "78127654321");
+ "91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile1));
string16 summary1 = profile1.Label();
EXPECT_EQ(ASCIIToUTF16("123 Zoo St., Hollywood"), summary1);
@@ -59,7 +59,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile1a;
autofill_test::SetProfileInfo(&profile1a, "", "Mitchell", "",
"johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA",
- "91601", "US", "16505678910", "78127654321");
+ "91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile1a));
string16 summary1a = profile1a.Label();
EXPECT_EQ(ASCIIToUTF16("123 Zoo St., unit 5"), summary1a);
@@ -68,7 +68,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile2;
autofill_test::SetProfileInfo(&profile2, "", "Mitchell",
"Morrison", "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA",
- "91601", "US", "16505678910", "78127654321");
+ "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.
@@ -78,7 +78,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile3;
autofill_test::SetProfileInfo(&profile3, "", "Mitchell",
"Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "",
- "Hollywood", "CA", "91601", "US", "16505678910", "78127654321");
+ "Hollywood", "CA", "91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile3));
string16 summary3 = profile3.Label();
EXPECT_EQ(ASCIIToUTF16("123 Zoo St., Hollywood"), summary3);
@@ -87,7 +87,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile4;
autofill_test::SetProfileInfo(&profile4, "Marion", "Mitchell", "",
"johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US",
- "16505678910", "01987654321");
+ "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile4));
string16 summary4 = profile4.Label();
EXPECT_EQ(ASCIIToUTF16("Marion Mitchell, Hollywood"), summary4);
@@ -96,7 +96,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile5;
autofill_test::SetProfileInfo(&profile5, "Marion", "Mitchell", "",
"johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA",
- "91601", "US", "16505678910", "78127654321");
+ "91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile5));
string16 summary5 = profile5.Label();
EXPECT_EQ(ASCIIToUTF16("Marion Mitchell, 123 Zoo St."), summary5);
@@ -105,7 +105,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile6;
autofill_test::SetProfileInfo(&profile6, "Marion", "Mitchell",
"Morrison", "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA",
- "91601", "US", "16505678910", "78127654321");
+ "91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile6));
string16 summary6 = profile6.Label();
EXPECT_EQ(ASCIIToUTF16("Marion Mitchell Morrison, Hollywood"),
@@ -115,7 +115,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile7;
autofill_test::SetProfileInfo(&profile7, "Marion", "Mitchell",
"Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5",
- "Hollywood", "CA", "91601", "US", "16505678910", "78127654321");
+ "Hollywood", "CA", "91601", "US", "16505678910");
EXPECT_TRUE(UpdateProfileLabel(&profile7));
string16 summary7 = profile7.Label();
EXPECT_EQ(ASCIIToUTF16("Marion Mitchell Morrison, 123 Zoo St."),
@@ -126,7 +126,7 @@ TEST_F(AutofillProfileTest, PreviewSummaryString) {
AutofillProfile profile7a;
autofill_test::SetProfileInfo(&profile7a, "Marion", "Mitchell",
"Morrison", "marion@me.xyz", "Fox", "123 Zoo St.", "unit 5",
- "Hollywood", "CA", "91601", "US", "16505678910", "78127654321");
+ "Hollywood", "CA", "91601", "US", "16505678910");
std::vector<AutofillProfile*> profiles;
profiles.push_back(&profile7);
profiles.push_back(&profile7a);
@@ -154,8 +154,7 @@ TEST_F(AutofillProfileTest, AdjustInferredLabels) {
"Elysium", "CA",
"91111",
"US",
- "16502111111",
- "16502222222");
+ "16502111111");
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(
profiles[1],
@@ -169,8 +168,7 @@ TEST_F(AutofillProfileTest, AdjustInferredLabels) {
"Dis", "CA",
"91222",
"US",
- "12345678910",
- "01987654321");
+ "12345678910");
// As labels are empty they are adjusted the first time.
EXPECT_TRUE(AutofillProfile::AdjustInferredLabels(&profiles));
// No need to adjust them anymore.
@@ -193,8 +191,7 @@ TEST_F(AutofillProfileTest, AdjustInferredLabels) {
"Elysium", "CA",
"91111",
"US",
- "16502111111",
- "16502222222");
+ "16502111111");
EXPECT_TRUE(AutofillProfile::AdjustInferredLabels(&profiles));
// Profile 0 and 2 inferred label now includes an e-mail.
@@ -218,20 +215,19 @@ TEST_F(AutofillProfileTest, AdjustInferredLabels) {
"Underworld",
"666 Erebus St.",
"",
- "Elysium", "CA",
+ "Elysium", "CO", // State is different
"91111",
"US",
- "16502111111",
- "16503333333"); // Fax is different
+ "16502111111");
EXPECT_TRUE(AutofillProfile::AdjustInferredLabels(&profiles));
- // Profile 0 and 2 inferred label now includes a fax number.
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., fax:#16502222222"),
+ // Profile 0 and 2 inferred label now includes a state.
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CA"),
profiles[0]->Label());
EXPECT_EQ(ASCIIToUTF16("Jane Doe, 123 Letha Shore."),
profiles[1]->Label());
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., fax:#16503333333"),
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CO"),
profiles[2]->Label());
profiles.push_back(new AutofillProfile);
@@ -244,25 +240,22 @@ TEST_F(AutofillProfileTest, AdjustInferredLabels) {
"Underworld",
"666 Erebus St.",
"",
- "Elysium", "CA",
+ "Elysium", "CO", // State is different for some.
"91111",
"US",
- "16504444444", // Phone is different for some.
- "16503333333"); // Fax is different for some.
+ "16504444444"); // Phone is different for some.
EXPECT_TRUE(AutofillProfile::AdjustInferredLabels(&profiles));
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., 16502111111,"
- " fax:#16502222222"),
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CA"),
profiles[0]->Label());
EXPECT_EQ(ASCIIToUTF16("Jane Doe, 123 Letha Shore."),
profiles[1]->Label());
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., 16502111111,"
- " fax:#16503333333"),
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CO, 16502111111"),
profiles[2]->Label());
// This one differs from other ones by unique phone, so no need for extra
// information.
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., 16504444444"),
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CO, 16504444444"),
profiles[3]->Label());
profiles.push_back(new AutofillProfile);
@@ -275,28 +268,26 @@ TEST_F(AutofillProfileTest, AdjustInferredLabels) {
"Underworld",
"666 Erebus St.",
"",
- "Elysium", "CA",
+ "Elysium", "CO", // State is different for some.
"91111",
"US",
- "16504444444", // Phone is different for some.
- "16503333333"); // Fax is different for some.
+ "16504444444"); // Phone is different for some.
EXPECT_TRUE(AutofillProfile::AdjustInferredLabels(&profiles));
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., johndoe@hades.com,"
- " 16502111111, fax:#16502222222"),
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CA"),
profiles[0]->Label());
EXPECT_EQ(ASCIIToUTF16("Jane Doe, 123 Letha Shore."),
profiles[1]->Label());
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., johndoe@hades.com,"
- " 16502111111, fax:#16503333333"),
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CO, johndoe@hades.com,"
+ " 16502111111"),
profiles[2]->Label());
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., johndoe@hades.com,"
- " 16504444444, fax:#16503333333"),
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CO, johndoe@hades.com,"
+ " 16504444444"),
profiles[3]->Label());
// This one differs from other ones by unique e-mail, so no need for extra
// information.
- EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., johndoe@styx.com"),
+ EXPECT_EQ(ASCIIToUTF16("John Doe, 666 Erebus St., CO, johndoe@styx.com"),
profiles[4]->Label());
EXPECT_FALSE(AutofillProfile::AdjustInferredLabels(&profiles));
@@ -319,8 +310,7 @@ TEST_F(AutofillProfileTest, CreateInferredLabels) {
"Elysium", "CA",
"91111",
"US",
- "16502111111",
- "16502222222");
+ "16502111111");
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(profiles[1],
"Jane",
@@ -333,8 +323,7 @@ TEST_F(AutofillProfileTest, CreateInferredLabels) {
"Dis", "CA",
"91222",
"US",
- "12345678910",
- "01987654321");
+ "12345678910");
std::vector<string16> labels;
// Two fields at least - no filter.
AutofillProfile::CreateInferredLabels(&profiles, NULL, UNKNOWN_TYPE, 2,
@@ -421,11 +410,11 @@ TEST_F(AutofillProfileTest, CreateInferredLabelsFallsBackToFullName) {
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(profiles[0],
"John", "", "Doe", "doe@example.com", "",
- "88 Nowhere Ave.", "", "", "", "", "", "", "");
+ "88 Nowhere Ave.", "", "", "", "", "", "");
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(profiles[1],
"Johnny", "K", "Doe", "doe@example.com", "",
- "88 Nowhere Ave.", "", "", "", "", "", "", "");
+ "88 Nowhere Ave.", "", "", "", "", "", "");
// If the only name field in the suggested fields is the excluded field, we
// should not fall back to the full name as a distinguishing field.
@@ -455,11 +444,11 @@ TEST_F(AutofillProfileTest, CreateInferredLabelsNoDuplicatedFields) {
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(profiles[0],
"John", "", "Doe", "doe@example.com", "",
- "88 Nowhere Ave.", "", "", "", "", "", "", "");
+ "88 Nowhere Ave.", "", "", "", "", "", "");
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(profiles[1],
"John", "", "Doe", "dojo@example.com", "",
- "88 Nowhere Ave.", "", "", "", "", "", "", "");
+ "88 Nowhere Ave.", "", "", "", "", "", "");
// If the only name field in the suggested fields is the excluded field, we
// should not fall back to the full name as a distinguishing field.
@@ -481,15 +470,15 @@ TEST_F(AutofillProfileTest, CreateInferredLabelsSkipsEmptyFields) {
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(profiles[0],
"John", "", "Doe", "doe@example.com",
- "Gogole", "", "", "", "", "", "", "", "");
+ "Gogole", "", "", "", "", "", "", "");
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(profiles[1],
"John", "", "Doe", "doe@example.com",
- "Ggoole", "", "", "", "", "", "", "", "");
+ "Ggoole", "", "", "", "", "", "", "");
profiles.push_back(new AutofillProfile);
autofill_test::SetProfileInfo(profiles[2],
"John", "", "Doe", "john.doe@example.com",
- "Goolge", "", "", "", "", "", "", "", "");
+ "Goolge", "", "", "", "", "", "", "");
std::vector<string16> labels;
AutofillProfile::CreateInferredLabels(&profiles.get(), NULL, UNKNOWN_TYPE, 3,
@@ -519,10 +508,10 @@ TEST_F(AutofillProfileTest, IsSubsetOf) {
b.reset(new AutofillProfile);
autofill_test::SetProfileInfo(a.get(), "Thomas", NULL, "Jefferson",
"declaration_guy@gmail.com", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL);
autofill_test::SetProfileInfo(b.get(), "Thomas", NULL, "Jefferson",
"declaration_guy@gmail.com", "United States Government", "Monticello",
- NULL, "Charlottesville", "Virginia", "22902", NULL, NULL, NULL);
+ NULL, "Charlottesville", "Virginia", "22902", NULL, NULL);
EXPECT_TRUE(a->IsSubsetOf(*b));
// |b| is not a subset of |a|.
@@ -536,10 +525,10 @@ TEST_F(AutofillProfileTest, IsSubsetOf) {
b.reset(new AutofillProfile);
autofill_test::SetProfileInfo(a.get(), "Thomas", NULL, "Jefferson",
"declaration_guy@gmail.com", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL);
autofill_test::SetProfileInfo(a.get(), "Thomas", NULL, "Adams",
"declaration_guy@gmail.com", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL);
+ NULL);
EXPECT_FALSE(a->IsSubsetOf(*b));
}
@@ -553,10 +542,10 @@ TEST_F(AutofillProfileTest, IntersectionOfTypesHasEqualValues) {
b.reset(new AutofillProfile);
autofill_test::SetProfileInfo(a.get(), "Thomas", NULL, "Jefferson",
"declaration_guy@gmail.com", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- "12134759123", "19384284720");
+ "12134759123");
autofill_test::SetProfileInfo(b.get(), "Thomas", NULL, "Jefferson",
"declaration_guy@gmail.com", "United States Government", "Monticello",
- NULL, "Charlottesville", "Virginia", "22902", NULL, NULL, NULL);
+ NULL, "Charlottesville", "Virginia", "22902", NULL, NULL);
EXPECT_TRUE(a->IntersectionOfTypesHasEqualValues(*b));
// Intersection of types contains the fields NAME_FIRST, NAME_LAST,
@@ -565,10 +554,10 @@ TEST_F(AutofillProfileTest, IntersectionOfTypesHasEqualValues) {
b.reset(new AutofillProfile);
autofill_test::SetProfileInfo(a.get(), "Thomas", NULL, "Jefferson",
"poser@yahoo.com", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- "12134759123", "19384284720");
+ "12134759123");
autofill_test::SetProfileInfo(b.get(), "Thomas", NULL, "Jefferson",\
"declaration_guy@gmail.com", "United States Government", "Monticello",
- NULL, "Charlottesville", "Virginia", "22902", NULL, NULL, NULL);
+ NULL, "Charlottesville", "Virginia", "22902", NULL, NULL);
EXPECT_FALSE(a->IntersectionOfTypesHasEqualValues(*b));
// Intersection of types is empty.
@@ -576,10 +565,10 @@ TEST_F(AutofillProfileTest, IntersectionOfTypesHasEqualValues) {
b.reset(new AutofillProfile);
autofill_test::SetProfileInfo(a.get(), "Thomas", NULL, "Jefferson",
"poser@yahoo.com", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- "12134759123", "19384284720");
+ "12134759123");
autofill_test::SetProfileInfo(b.get(), NULL, NULL, NULL, NULL,
"United States Government", "Monticello", NULL, "Charlottesville",
- "Virginia", "22902", NULL, NULL, NULL);
+ "Virginia", "22902", NULL, NULL);
EXPECT_FALSE(a->IntersectionOfTypesHasEqualValues(*b));
}
@@ -590,18 +579,17 @@ TEST_F(AutofillProfileTest, MergeWith) {
a.reset(new AutofillProfile);
b.reset(new AutofillProfile);
autofill_test::SetProfileInfo(a.get(), "Jimmy", NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, "12134759123", "19384284720");
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, "12134759123");
autofill_test::SetProfileInfo(b.get(), "James", NULL, "Madison",
"constitutionalist@gmail.com", "United States Government", "Monticello",
- NULL, "Charlottesville", "Virginia", "22902", NULL, NULL, NULL);
+ NULL, "Charlottesville", "Virginia", "22902", NULL, NULL);
AutofillProfile expected_b(*b);
a->MergeWith(*b);
AutofillProfile expected_a;
autofill_test::SetProfileInfo(&expected_a, "Jimmy", NULL, "Madison",
"constitutionalist@gmail.com", "United States Government", "Monticello",
- NULL, "Charlottesville", "Virginia", "22902", NULL, "12134759123",
- "19384284720");
+ NULL, "Charlottesville", "Virginia", "22902", NULL, "12134759123");
EXPECT_EQ(0, expected_a.Compare(*a));
EXPECT_EQ(0, expected_b.Compare(*b));
}
@@ -612,8 +600,8 @@ TEST_F(AutofillProfileTest, AssignmentOperator){
// Result of assignment should be logically equal to the original profile.
autofill_test::SetProfileInfo(&a, "Marion", "Mitchell", "Morrison",
"marion@me.xyz", "Fox", "123 Zoo St.", "unit 5",
- "Hollywood", "CA", "91601", "US", "12345678910",
- "01987654321");
+ "Hollywood", "CA", "91601", "US",
+ "12345678910");
b = a;
EXPECT_TRUE(a == b);
@@ -628,8 +616,8 @@ TEST_F(AutofillProfileTest, Copy) {
// Clone should be logically equal to the original.
autofill_test::SetProfileInfo(&a, "Marion", "Mitchell", "Morrison",
"marion@me.xyz", "Fox", "123 Zoo St.", "unit 5",
- "Hollywood", "CA", "91601", "US", "12345678910",
- "01987654321");
+ "Hollywood", "CA", "91601", "US",
+ "12345678910");
AutofillProfile b(a);
EXPECT_TRUE(a == b);
}
@@ -647,9 +635,9 @@ TEST_F(AutofillProfileTest, Compare) {
// Different values produce non-zero results.
autofill_test::SetProfileInfo(&a, "Jimmy", NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
autofill_test::SetProfileInfo(&b, "Ringo", NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
EXPECT_GT(0, a.Compare(b));
EXPECT_LT(0, b.Compare(a));
}
@@ -793,47 +781,3 @@ TEST_F(AutofillProfileTest, MultiValuePhone) {
// Expect regular |GetInfo| returns empty value.
EXPECT_EQ(string16(), p.GetInfo(PHONE_HOME_WHOLE_NUMBER));
}
-
-TEST_F(AutofillProfileTest, MultiValueFax) {
- AutofillProfile p;
- const string16 kJohnDoe(ASCIIToUTF16("4152112222"));
- const string16 kJohnPDoe(ASCIIToUTF16("4153113333"));
- std::vector<string16> set_values;
- set_values.push_back(kJohnDoe);
- set_values.push_back(kJohnPDoe);
- p.SetMultiInfo(PHONE_FAX_WHOLE_NUMBER, set_values);
-
- // Expect regular |GetInfo| returns the first element.
- EXPECT_EQ(kJohnDoe, p.GetInfo(PHONE_FAX_WHOLE_NUMBER));
-
- // Ensure that we get out what we put in.
- std::vector<string16> get_values;
- p.GetMultiInfo(PHONE_FAX_WHOLE_NUMBER, &get_values);
- ASSERT_EQ(2UL, get_values.size());
- EXPECT_EQ(kJohnDoe, get_values[0]);
- EXPECT_EQ(kJohnPDoe, get_values[1]);
-
- // Update the values.
- AutofillProfile p2 = p;
- EXPECT_EQ(0, p.Compare(p2));
- EXPECT_EQ(0, p.CompareMulti(p2));
- const string16 kNoOne(ASCIIToUTF16("4151110000"));
- set_values[1] = kNoOne;
- p.SetMultiInfo(PHONE_FAX_WHOLE_NUMBER, set_values);
- p.GetMultiInfo(PHONE_FAX_WHOLE_NUMBER, &get_values);
- ASSERT_EQ(2UL, get_values.size());
- EXPECT_EQ(kJohnDoe, get_values[0]);
- EXPECT_EQ(kNoOne, get_values[1]);
- EXPECT_EQ(0, p.Compare(p2));
- EXPECT_NE(0, p.CompareMulti(p2));
-
- // Delete values.
- set_values.clear();
- p.SetMultiInfo(PHONE_FAX_WHOLE_NUMBER, set_values);
- p.GetMultiInfo(PHONE_FAX_WHOLE_NUMBER, &get_values);
- ASSERT_EQ(1UL, get_values.size());
- EXPECT_EQ(string16(), get_values[0]);
-
- // Expect regular |GetInfo| returns empty value.
- EXPECT_EQ(string16(), p.GetInfo(PHONE_FAX_WHOLE_NUMBER));
-}
« no previous file with comments | « chrome/browser/autofill/autofill_profile.cc ('k') | chrome/browser/autofill/autofill_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698