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

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

Issue 6673079: Reduce boxing and unboxing of AutofillFieldType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Compile on Windows. Created 9 years, 9 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: chrome/browser/autofill/address_unittest.cc
diff --git a/chrome/browser/autofill/address_unittest.cc b/chrome/browser/autofill/address_unittest.cc
index 11ae945e4066c6a330dca03880261b795670fc8c..e6a8706f27e4ad0c9a4fbc84cacd466d2885768a 100644
--- a/chrome/browser/autofill/address_unittest.cc
+++ b/chrome/browser/autofill/address_unittest.cc
@@ -28,15 +28,15 @@ TEST(AddressTest, GetCountry) {
EXPECT_EQ(std::string(), address.country_code());
// Make sure that nothing breaks when the country code is missing.
- string16 country = address.GetFieldText(AutofillType(ADDRESS_HOME_COUNTRY));
+ string16 country = address.GetFieldText(ADDRESS_HOME_COUNTRY);
EXPECT_EQ(string16(), country);
address.set_country_code("US");
- country = address.GetFieldText(AutofillType(ADDRESS_HOME_COUNTRY));
+ country = address.GetFieldText(ADDRESS_HOME_COUNTRY);
EXPECT_EQ(ASCIIToUTF16("United States"), country);
address.set_country_code("CA");
- country = address.GetFieldText(AutofillType(ADDRESS_HOME_COUNTRY));
+ country = address.GetFieldText(ADDRESS_HOME_COUNTRY);
EXPECT_EQ(ASCIIToUTF16("Canada"), country);
}
@@ -46,33 +46,33 @@ TEST(AddressTest, SetCountry) {
EXPECT_EQ(std::string(), address.country_code());
// Test basic conversion.
- address.SetInfo(AutofillType(ADDRESS_HOME_COUNTRY),
+ address.SetInfo(ADDRESS_HOME_COUNTRY,
ASCIIToUTF16("United States"));
dhollowa 2011/03/16 17:07:11 nit: indent.
Ilya Sherman 2011/03/17 03:42:29 Done.
- string16 country = address.GetFieldText(AutofillType(ADDRESS_HOME_COUNTRY));
+ string16 country = address.GetFieldText(ADDRESS_HOME_COUNTRY);
EXPECT_EQ("US", address.country_code());
EXPECT_EQ(ASCIIToUTF16("United States"), country);
// Test basic synonym detection.
- address.SetInfo(AutofillType(ADDRESS_HOME_COUNTRY), ASCIIToUTF16("USA"));
- country = address.GetFieldText(AutofillType(ADDRESS_HOME_COUNTRY));
+ address.SetInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("USA"));
+ country = address.GetFieldText(ADDRESS_HOME_COUNTRY);
EXPECT_EQ("US", address.country_code());
EXPECT_EQ(ASCIIToUTF16("United States"), country);
// Test case-insensitivity.
- address.SetInfo(AutofillType(ADDRESS_HOME_COUNTRY), ASCIIToUTF16("canADA"));
- country = address.GetFieldText(AutofillType(ADDRESS_HOME_COUNTRY));
+ address.SetInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("canADA"));
+ country = address.GetFieldText(ADDRESS_HOME_COUNTRY);
EXPECT_EQ("CA", address.country_code());
EXPECT_EQ(ASCIIToUTF16("Canada"), country);
// Test country code detection.
- address.SetInfo(AutofillType(ADDRESS_HOME_COUNTRY), ASCIIToUTF16("JP"));
- country = address.GetFieldText(AutofillType(ADDRESS_HOME_COUNTRY));
+ address.SetInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("JP"));
+ country = address.GetFieldText(ADDRESS_HOME_COUNTRY);
EXPECT_EQ("JP", address.country_code());
EXPECT_EQ(ASCIIToUTF16("Japan"), country);
// Test that we ignore unknown countries.
- address.SetInfo(AutofillType(ADDRESS_HOME_COUNTRY), ASCIIToUTF16("Unknown"));
- country = address.GetFieldText(AutofillType(ADDRESS_HOME_COUNTRY));
+ address.SetInfo(ADDRESS_HOME_COUNTRY, ASCIIToUTF16("Unknown"));
+ country = address.GetFieldText(ADDRESS_HOME_COUNTRY);
EXPECT_EQ(std::string(), address.country_code());
EXPECT_EQ(string16(), country);
}

Powered by Google App Engine
This is Rietveld 408576698