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

Unified Diff: components/autofill/core/browser/autofill_country_unittest.cc

Issue 389733002: Reland "Use upstream libaddressinput in Chrome." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix GN build. Created 6 years, 5 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: components/autofill/core/browser/autofill_country_unittest.cc
diff --git a/components/autofill/core/browser/autofill_country_unittest.cc b/components/autofill/core/browser/autofill_country_unittest.cc
index 09959c0cea1aaa820bf6e5cf2ca751ecd36d0753..fcaf46f6fc2af01b8876dbd5de40bceac34b8aee 100644
--- a/components/autofill/core/browser/autofill_country_unittest.cc
+++ b/components/autofill/core/browser/autofill_country_unittest.cc
@@ -89,4 +89,20 @@ TEST(AutofillCountryTest, GetCountryCode) {
EXPECT_EQ("US", AutofillCountry::GetCountryCode(ASCIIToUTF16("USA"), "es"));
}
+// Test mapping of empty country name to country code.
+TEST(AutofillCountryTest, EmptyCountryNameHasEmptyCountryCode) {
+ EXPECT_TRUE(AutofillCountry::GetCountryCode(base::string16(), "en").empty());
+}
+
+// Test mapping all country codes to country names.
+TEST(AutofillCountryTest, AllCountryCodesHaveCountryName) {
+ std::vector<std::string> country_codes;
+ AutofillCountry::GetAvailableCountries(&country_codes);
+ for (size_t i = 0; i < country_codes.size(); ++i) {
+ SCOPED_TRACE("Country code '" + country_codes[i] + "' should have a name.");
+ EXPECT_NE(ASCIIToUTF16(country_codes[i]),
+ AutofillCountry(country_codes[i], "en").name());
+ }
+}
+
} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/autofill_country.cc ('k') | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698