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

Unified Diff: chrome/browser/autofill/phone_number_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/phone_number.cc ('k') | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/phone_number_unittest.cc
diff --git a/chrome/browser/autofill/phone_number_unittest.cc b/chrome/browser/autofill/phone_number_unittest.cc
index 9a0641826141fa5cf6c935dac0e4858f969143e0..9c0dd4e15459f8c569ef9e418cef71f653578019 100644
--- a/chrome/browser/autofill/phone_number_unittest.cc
+++ b/chrome/browser/autofill/phone_number_unittest.cc
@@ -14,7 +14,7 @@ TEST(PhoneNumberTest, Matcher) {
profile.SetCountryCode("US");
// Set phone number so country_code == 1, city_code = 650, number = 2345678.
string16 phone(ASCIIToUTF16("1 [650] 234-5678"));
- PhoneNumber phone_number(AutofillType::PHONE_HOME, &profile);
+ PhoneNumber phone_number(&profile);
phone_number.SetInfo(PHONE_HOME_WHOLE_NUMBER, phone);
phone_number.NormalizePhone();
@@ -75,32 +75,12 @@ TEST(PhoneNumberTest, Matcher) {
EXPECT_EQ(1U, matching_types.size());
EXPECT_TRUE(matching_types.find(PHONE_HOME_CITY_AND_NUMBER) !=
matching_types.end());
-
- string16 fax(ASCIIToUTF16("+1(650)650-5678"));
- PhoneNumber fax_number(&profile);
- fax_number.SetInfo(PHONE_FAX_WHOLE_NUMBER, fax);
-
- matching_types.clear();
- fax_number.GetMatchingTypes(ASCIIToUTF16("16506505678"), &matching_types);
- EXPECT_EQ(1U, matching_types.size());
- EXPECT_TRUE(matching_types.find(PHONE_FAX_WHOLE_NUMBER) !=
- matching_types.end());
-
- matching_types.clear();
- fax_number.GetMatchingTypes(ASCIIToUTF16("650"), &matching_types);
- EXPECT_EQ(2U, matching_types.size());
- EXPECT_TRUE(matching_types.find(PHONE_FAX_CITY_CODE) !=
- matching_types.end());
- EXPECT_TRUE(matching_types.find(PHONE_FAX_NUMBER) !=
- matching_types.end());
}
TEST(PhoneNumberTest, PhoneCombineHelper) {
- PhoneNumber::PhoneCombineHelper number1(AutofillType::PHONE_HOME);
+ PhoneNumber::PhoneCombineHelper number1;
EXPECT_FALSE(number1.SetInfo(ADDRESS_BILLING_CITY,
ASCIIToUTF16("1")));
- EXPECT_FALSE(number1.SetInfo(PHONE_FAX_COUNTRY_CODE,
- ASCIIToUTF16("1")));
EXPECT_TRUE(number1.SetInfo(PHONE_HOME_COUNTRY_CODE,
ASCIIToUTF16("1")));
EXPECT_TRUE(number1.SetInfo(PHONE_HOME_CITY_CODE,
@@ -112,20 +92,7 @@ TEST(PhoneNumberTest, PhoneCombineHelper) {
// International format as it has a country code.
EXPECT_EQ(ASCIIToUTF16("+1 650-234-5678"), parsed_phone);
- PhoneNumber::PhoneCombineHelper number2(AutofillType::PHONE_FAX);
- EXPECT_FALSE(number2.SetInfo(PHONE_HOME_COUNTRY_CODE,
- ASCIIToUTF16("1")));
- EXPECT_TRUE(number2.SetInfo(PHONE_FAX_COUNTRY_CODE,
- ASCIIToUTF16("1")));
- EXPECT_TRUE(number2.SetInfo(PHONE_FAX_CITY_CODE,
- ASCIIToUTF16("650")));
- EXPECT_TRUE(number2.SetInfo(PHONE_FAX_NUMBER,
- ASCIIToUTF16("2345679")));
- EXPECT_TRUE(number2.ParseNumber("US", &parsed_phone));
- // International format as it has a country code.
- EXPECT_EQ(ASCIIToUTF16("+1 650-234-5679"), parsed_phone);
-
- PhoneNumber::PhoneCombineHelper number3(AutofillType::PHONE_HOME);
+ PhoneNumber::PhoneCombineHelper number3;
EXPECT_TRUE(number3.SetInfo(PHONE_HOME_CITY_CODE,
ASCIIToUTF16("650")));
EXPECT_TRUE(number3.SetInfo(PHONE_HOME_NUMBER,
@@ -134,7 +101,7 @@ TEST(PhoneNumberTest, PhoneCombineHelper) {
// National format as it does not have a country code.
EXPECT_EQ(ASCIIToUTF16("(650) 234-5680"), parsed_phone);
- PhoneNumber::PhoneCombineHelper number4(AutofillType::PHONE_HOME);
+ PhoneNumber::PhoneCombineHelper number4;
EXPECT_TRUE(number4.SetInfo(PHONE_HOME_CITY_CODE,
ASCIIToUTF16("123"))); // Incorrect city code.
EXPECT_TRUE(number4.SetInfo(PHONE_HOME_NUMBER,
@@ -142,13 +109,13 @@ TEST(PhoneNumberTest, PhoneCombineHelper) {
EXPECT_FALSE(number4.ParseNumber("US", &parsed_phone));
EXPECT_EQ(string16(), parsed_phone);
- PhoneNumber::PhoneCombineHelper number5(AutofillType::PHONE_HOME);
+ PhoneNumber::PhoneCombineHelper number5;
EXPECT_TRUE(number5.SetInfo(PHONE_HOME_CITY_AND_NUMBER,
ASCIIToUTF16("6502345681")));
EXPECT_TRUE(number5.ParseNumber("US", &parsed_phone));
EXPECT_EQ(ASCIIToUTF16("(650) 234-5681"), parsed_phone);
- PhoneNumber::PhoneCombineHelper number6(AutofillType::PHONE_HOME);
+ PhoneNumber::PhoneCombineHelper number6;
EXPECT_TRUE(number6.SetInfo(PHONE_HOME_CITY_CODE,
ASCIIToUTF16("650")));
EXPECT_TRUE(number6.SetInfo(PHONE_HOME_NUMBER,
« no previous file with comments | « chrome/browser/autofill/phone_number.cc ('k') | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698