diff options
Diffstat (limited to 'components/autofill/browser/autofill_profile_unittest.cc')
-rw-r--r-- | components/autofill/browser/autofill_profile_unittest.cc | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/components/autofill/browser/autofill_profile_unittest.cc b/components/autofill/browser/autofill_profile_unittest.cc index 1fb38c1..71c03cc 100644 --- a/components/autofill/browser/autofill_profile_unittest.cc +++ b/components/autofill/browser/autofill_profile_unittest.cc @@ -33,8 +33,8 @@ TEST(AutofillProfileTest, PreviewSummaryString) { AutofillProfile profile0; // Empty profile - nothing to update. EXPECT_FALSE(UpdateProfileLabel(&profile0)); - string16 summary0 = profile0.Label(); - EXPECT_EQ(string16(), summary0); + base::string16 summary0 = profile0.Label(); + EXPECT_EQ(base::string16(), summary0); // Case 0a/empty name and address, so the first two fields of the rest of the // data is used: "Hollywood, CA" @@ -43,7 +43,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile00)); - string16 summary00 = profile00.Label(); + base::string16 summary00 = profile00.Label(); EXPECT_EQ(ASCIIToUTF16("Hollywood, CA"), summary00); // Case 1: "<address>" without line 2. @@ -52,7 +52,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "johnwayne@me.xyz", "Fox", "123 Zoo St.", "", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile1)); - string16 summary1 = profile1.Label(); + base::string16 summary1 = profile1.Label(); EXPECT_EQ(ASCIIToUTF16("123 Zoo St., Hollywood"), summary1); // Case 1a: "<address>" with line 2. @@ -61,7 +61,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile1a)); - string16 summary1a = profile1a.Label(); + base::string16 summary1a = profile1a.Label(); EXPECT_EQ(ASCIIToUTF16("123 Zoo St., unit 5"), summary1a); // Case 2: "<lastname>" @@ -70,7 +70,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "Morrison", "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile2)); - string16 summary2 = profile2.Label(); + base::string16 summary2 = profile2.Label(); // Summary includes full name, to the maximal extent available. EXPECT_EQ(ASCIIToUTF16("Mitchell Morrison, Hollywood"), summary2); @@ -80,7 +80,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile3)); - string16 summary3 = profile3.Label(); + base::string16 summary3 = profile3.Label(); EXPECT_EQ(ASCIIToUTF16("Mitchell Morrison, 123 Zoo St."), summary3); // Case 4: "<firstname>" @@ -89,7 +89,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile4)); - string16 summary4 = profile4.Label(); + base::string16 summary4 = profile4.Label(); EXPECT_EQ(ASCIIToUTF16("Marion Mitchell, Hollywood"), summary4); // Case 5: "<firstname>, <address>" @@ -98,7 +98,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile5)); - string16 summary5 = profile5.Label(); + base::string16 summary5 = profile5.Label(); EXPECT_EQ(ASCIIToUTF16("Marion Mitchell, 123 Zoo St."), summary5); // Case 6: "<firstname> <lastname>" @@ -107,7 +107,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "Morrison", "johnwayne@me.xyz", "Fox", "", "", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile6)); - string16 summary6 = profile6.Label(); + base::string16 summary6 = profile6.Label(); EXPECT_EQ(ASCIIToUTF16("Marion Mitchell Morrison, Hollywood"), summary6); @@ -117,7 +117,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { "Morrison", "johnwayne@me.xyz", "Fox", "123 Zoo St.", "unit 5", "Hollywood", "CA", "91601", "US", "16505678910"); EXPECT_TRUE(UpdateProfileLabel(&profile7)); - string16 summary7 = profile7.Label(); + base::string16 summary7 = profile7.Label(); EXPECT_EQ(ASCIIToUTF16("Marion Mitchell Morrison, 123 Zoo St."), summary7); @@ -132,7 +132,7 @@ TEST(AutofillProfileTest, PreviewSummaryString) { profiles.push_back(&profile7a); EXPECT_TRUE(AutofillProfile::AdjustInferredLabels(&profiles)); summary7 = profile7.Label(); - string16 summary7a = profile7a.Label(); + base::string16 summary7a = profile7a.Label(); EXPECT_EQ(ASCIIToUTF16( "Marion Mitchell Morrison, 123 Zoo St., johnwayne@me.xyz"), summary7); EXPECT_EQ(ASCIIToUTF16( @@ -324,7 +324,7 @@ TEST(AutofillProfileTest, CreateInferredLabels) { "91222", "US", "12345678910"); - std::vector<string16> labels; + std::vector<base::string16> labels; // Two fields at least - no filter. AutofillProfile::CreateInferredLabels(&profiles, NULL, UNKNOWN_TYPE, 2, &labels); @@ -376,8 +376,8 @@ TEST(AutofillProfileTest, CreateInferredLabels) { // field. AutofillProfile::CreateInferredLabels(&profiles, &suggested_fields, NAME_MIDDLE, 1, &labels); - EXPECT_EQ(string16(), labels[0]); - EXPECT_EQ(string16(), labels[1]); + EXPECT_EQ(base::string16(), labels[0]); + EXPECT_EQ(base::string16(), labels[1]); suggested_fields.clear(); // In our implementation we always display NAME_FULL for NAME_MIDDLE_INITIAL @@ -396,8 +396,8 @@ TEST(AutofillProfileTest, CreateInferredLabels) { suggested_fields.push_back(ADDRESS_HOME_LINE1); AutofillProfile::CreateInferredLabels(&profiles, &suggested_fields, NAME_FULL, 1, &labels); - EXPECT_EQ(string16(ASCIIToUTF16("666 Erebus St.")), labels[0]); - EXPECT_EQ(string16(ASCIIToUTF16("123 Letha Shore.")), labels[1]); + EXPECT_EQ(base::string16(ASCIIToUTF16("666 Erebus St.")), labels[0]); + EXPECT_EQ(base::string16(ASCIIToUTF16("123 Letha Shore.")), labels[1]); // Clean up. STLDeleteContainerPointers(profiles.begin(), profiles.end()); @@ -422,7 +422,7 @@ TEST(AutofillProfileTest, CreateInferredLabelsFallsBackToFullName) { suggested_fields.push_back(NAME_LAST); suggested_fields.push_back(ADDRESS_HOME_LINE1); suggested_fields.push_back(EMAIL_ADDRESS); - std::vector<string16> labels; + std::vector<base::string16> labels; AutofillProfile::CreateInferredLabels(&profiles.get(), &suggested_fields, NAME_LAST, 1, &labels); ASSERT_EQ(2U, labels.size()); @@ -456,7 +456,7 @@ TEST(AutofillProfileTest, CreateInferredLabelsNoDuplicatedFields) { suggested_fields.push_back(ADDRESS_HOME_LINE1); suggested_fields.push_back(ADDRESS_BILLING_LINE1); suggested_fields.push_back(EMAIL_ADDRESS); - std::vector<string16> labels; + std::vector<base::string16> labels; AutofillProfile::CreateInferredLabels(&profiles.get(), &suggested_fields, UNKNOWN_TYPE, 2, &labels); ASSERT_EQ(2U, labels.size()); @@ -480,7 +480,7 @@ TEST(AutofillProfileTest, CreateInferredLabelsSkipsEmptyFields) { "John", "", "Doe", "john.doe@example.com", "Goolge", "", "", "", "", "", "", ""); - std::vector<string16> labels; + std::vector<base::string16> labels; AutofillProfile::CreateInferredLabels(&profiles.get(), NULL, UNKNOWN_TYPE, 3, &labels); ASSERT_EQ(3U, labels.size()); @@ -591,9 +591,9 @@ TEST(AutofillProfileTest, Compare) { TEST(AutofillProfileTest, MultiValueNames) { AutofillProfile p; - const string16 kJohnDoe(ASCIIToUTF16("John Doe")); - const string16 kJohnPDoe(ASCIIToUTF16("John P. Doe")); - std::vector<string16> set_values; + const base::string16 kJohnDoe(ASCIIToUTF16("John Doe")); + const base::string16 kJohnPDoe(ASCIIToUTF16("John P. Doe")); + std::vector<base::string16> set_values; set_values.push_back(kJohnDoe); set_values.push_back(kJohnPDoe); p.SetRawMultiInfo(NAME_FULL, set_values); @@ -602,7 +602,7 @@ TEST(AutofillProfileTest, MultiValueNames) { EXPECT_EQ(kJohnDoe, p.GetRawInfo(NAME_FULL)); // Ensure that we get out what we put in. - std::vector<string16> get_values; + std::vector<base::string16> get_values; p.GetRawMultiInfo(NAME_FULL, &get_values); ASSERT_EQ(2UL, get_values.size()); EXPECT_EQ(kJohnDoe, get_values[0]); @@ -611,7 +611,7 @@ TEST(AutofillProfileTest, MultiValueNames) { // Update the values. AutofillProfile p2 = p; EXPECT_EQ(0, p.Compare(p2)); - const string16 kNoOne(ASCIIToUTF16("No One")); + const base::string16 kNoOne(ASCIIToUTF16("No One")); set_values[1] = kNoOne; p.SetRawMultiInfo(NAME_FULL, set_values); p.GetRawMultiInfo(NAME_FULL, &get_values); @@ -625,17 +625,17 @@ TEST(AutofillProfileTest, MultiValueNames) { p.SetRawMultiInfo(NAME_FULL, set_values); p.GetRawMultiInfo(NAME_FULL, &get_values); ASSERT_EQ(1UL, get_values.size()); - EXPECT_EQ(string16(), get_values[0]); + EXPECT_EQ(base::string16(), get_values[0]); // Expect regular |GetInfo| returns empty value. - EXPECT_EQ(string16(), p.GetRawInfo(NAME_FULL)); + EXPECT_EQ(base::string16(), p.GetRawInfo(NAME_FULL)); } TEST(AutofillProfileTest, MultiValueEmails) { AutofillProfile p; - const string16 kJohnDoe(ASCIIToUTF16("john@doe.com")); - const string16 kJohnPDoe(ASCIIToUTF16("john_p@doe.com")); - std::vector<string16> set_values; + const base::string16 kJohnDoe(ASCIIToUTF16("john@doe.com")); + const base::string16 kJohnPDoe(ASCIIToUTF16("john_p@doe.com")); + std::vector<base::string16> set_values; set_values.push_back(kJohnDoe); set_values.push_back(kJohnPDoe); p.SetRawMultiInfo(EMAIL_ADDRESS, set_values); @@ -644,7 +644,7 @@ TEST(AutofillProfileTest, MultiValueEmails) { EXPECT_EQ(kJohnDoe, p.GetRawInfo(EMAIL_ADDRESS)); // Ensure that we get out what we put in. - std::vector<string16> get_values; + std::vector<base::string16> get_values; p.GetRawMultiInfo(EMAIL_ADDRESS, &get_values); ASSERT_EQ(2UL, get_values.size()); EXPECT_EQ(kJohnDoe, get_values[0]); @@ -653,7 +653,7 @@ TEST(AutofillProfileTest, MultiValueEmails) { // Update the values. AutofillProfile p2 = p; EXPECT_EQ(0, p.Compare(p2)); - const string16 kNoOne(ASCIIToUTF16("no@one.com")); + const base::string16 kNoOne(ASCIIToUTF16("no@one.com")); set_values[1] = kNoOne; p.SetRawMultiInfo(EMAIL_ADDRESS, set_values); p.GetRawMultiInfo(EMAIL_ADDRESS, &get_values); @@ -667,17 +667,17 @@ TEST(AutofillProfileTest, MultiValueEmails) { p.SetRawMultiInfo(EMAIL_ADDRESS, set_values); p.GetRawMultiInfo(EMAIL_ADDRESS, &get_values); ASSERT_EQ(1UL, get_values.size()); - EXPECT_EQ(string16(), get_values[0]); + EXPECT_EQ(base::string16(), get_values[0]); // Expect regular |GetInfo| returns empty value. - EXPECT_EQ(string16(), p.GetRawInfo(EMAIL_ADDRESS)); + EXPECT_EQ(base::string16(), p.GetRawInfo(EMAIL_ADDRESS)); } TEST(AutofillProfileTest, MultiValuePhone) { AutofillProfile p; - const string16 kJohnDoe(ASCIIToUTF16("4151112222")); - const string16 kJohnPDoe(ASCIIToUTF16("4151113333")); - std::vector<string16> set_values; + const base::string16 kJohnDoe(ASCIIToUTF16("4151112222")); + const base::string16 kJohnPDoe(ASCIIToUTF16("4151113333")); + std::vector<base::string16> set_values; set_values.push_back(kJohnDoe); set_values.push_back(kJohnPDoe); p.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, set_values); @@ -686,7 +686,7 @@ TEST(AutofillProfileTest, MultiValuePhone) { EXPECT_EQ(kJohnDoe, p.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); // Ensure that we get out what we put in. - std::vector<string16> get_values; + std::vector<base::string16> get_values; p.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &get_values); ASSERT_EQ(2UL, get_values.size()); EXPECT_EQ(kJohnDoe, get_values[0]); @@ -695,7 +695,7 @@ TEST(AutofillProfileTest, MultiValuePhone) { // Update the values. AutofillProfile p2 = p; EXPECT_EQ(0, p.Compare(p2)); - const string16 kNoOne(ASCIIToUTF16("4152110000")); + const base::string16 kNoOne(ASCIIToUTF16("4152110000")); set_values[1] = kNoOne; p.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, set_values); p.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &get_values); @@ -709,17 +709,17 @@ TEST(AutofillProfileTest, MultiValuePhone) { p.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, set_values); p.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &get_values); ASSERT_EQ(1UL, get_values.size()); - EXPECT_EQ(string16(), get_values[0]); + EXPECT_EQ(base::string16(), get_values[0]); // Expect regular |GetInfo| returns empty value. - EXPECT_EQ(string16(), p.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); + EXPECT_EQ(base::string16(), p.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); } TEST(AutofillProfileTest, AddressCountryFull) { const char* const kCountries[] = { "Albania", "Canada" }; - std::vector<string16> options(arraysize(kCountries)); + std::vector<base::string16> options(arraysize(kCountries)); for (size_t i = 0; i < arraysize(kCountries); ++i) { options[i] = ASCIIToUTF16(kCountries[i]); } @@ -739,7 +739,7 @@ TEST(AutofillProfileTest, AddressCountryAbbrev) { const char* const kCountries[] = { "AL", "CA" }; - std::vector<string16> options(arraysize(kCountries)); + std::vector<base::string16> options(arraysize(kCountries)); for (size_t i = 0; i < arraysize(kCountries); ++i) { options[i] = ASCIIToUTF16(kCountries[i]); } @@ -759,7 +759,7 @@ TEST(AutofillProfileTest, AddressStateFull) { const char* const kStates[] = { "Alabama", "California" }; - std::vector<string16> options(arraysize(kStates)); + std::vector<base::string16> options(arraysize(kStates)); for (size_t i = 0; i < arraysize(kStates); ++i) { options[i] = ASCIIToUTF16(kStates[i]); } @@ -779,7 +779,7 @@ TEST(AutofillProfileTest, AddressStateAbbrev) { const char* const kStates[] = { "AL", "CA" }; - std::vector<string16> options(arraysize(kStates)); + std::vector<base::string16> options(arraysize(kStates)); for (size_t i = 0; i < arraysize(kStates); ++i) { options[i] = ASCIIToUTF16(kStates[i]); } @@ -799,8 +799,8 @@ TEST(AutofillProfileTest, FillByValue) { const char* const kStates[] = { "Alabama", "California" }; - std::vector<string16> values(arraysize(kStates)); - std::vector<string16> contents(arraysize(kStates)); + std::vector<base::string16> values(arraysize(kStates)); + std::vector<base::string16> contents(arraysize(kStates)); for (unsigned int i = 0; i < arraysize(kStates); ++i) { values[i] = ASCIIToUTF16(kStates[i]); contents[i] = ASCIIToUTF16(base::StringPrintf("%u", i)); @@ -821,8 +821,8 @@ TEST(AutofillProfileTest, FillByContents) { const char* const kStates[] = { "Alabama", "California" }; - std::vector<string16> values(arraysize(kStates)); - std::vector<string16> contents(arraysize(kStates)); + std::vector<base::string16> values(arraysize(kStates)); + std::vector<base::string16> contents(arraysize(kStates)); for (unsigned int i = 0; i < arraysize(kStates); ++i) { values[i] = ASCIIToUTF16(base::StringPrintf("%u", i + 1)); contents[i] = ASCIIToUTF16(kStates[i]); |