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

Unified Diff: chrome/browser/ui/autofill/country_combobox_model_unittest.cc

Issue 172783003: rAc: don't show countries with partially supported address fields for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile Created 6 years, 10 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/ui/autofill/country_combobox_model_unittest.cc
diff --git a/chrome/browser/ui/autofill/country_combobox_model_unittest.cc b/chrome/browser/ui/autofill/country_combobox_model_unittest.cc
index b9986c9ebc2081d080d6cb3040396999cc4ed847..4a161e2f558406e1e3bff6ab148f107915f74f4d 100644
--- a/chrome/browser/ui/autofill/country_combobox_model_unittest.cc
+++ b/chrome/browser/ui/autofill/country_combobox_model_unittest.cc
@@ -17,13 +17,13 @@ TEST(CountryComboboxModel, RespectsManagerDefaultCountry) {
TestPersonalDataManager manager;
manager.set_timezone_country_code(test_country);
- CountryComboboxModel model(manager);
+ CountryComboboxModel model(manager, true);
EXPECT_EQ(test_country, model.GetDefaultCountryCode());
}
TEST(CountryComboboxModel, AllCountriesHaveComponents) {
TestPersonalDataManager manager;
- CountryComboboxModel model(manager);
+ CountryComboboxModel model(manager, true);
for (int i = 0; i < model.GetItemCount(); ++i) {
if (model.IsItemSeparatorAt(i))
@@ -36,4 +36,22 @@ TEST(CountryComboboxModel, AllCountriesHaveComponents) {
}
}
+TEST(CountryComboboxModel, CountriesWithDependentLocalityNotShown) {
+ TestPersonalDataManager manager;
+ manager.set_timezone_country_code("KR");
+ CountryComboboxModel model(manager, false);
+ EXPECT_NE("KR", model.GetDefaultCountryCode());
+
+ for (int i = 0; i < model.GetItemCount(); ++i) {
+ ASSERT_FALSE(model.IsItemSeparatorAt(i));
+ std::string country_code = model.countries()[i]->country_code();
+ std::vector< ::i18n::addressinput::AddressUiComponent> components =
+ ::i18n::addressinput::BuildComponents(country_code);
+ ASSERT_FALSE(components.empty());
+ for (size_t j = 0; j < components.size(); ++j) {
+ EXPECT_NE(components[j].field, ::i18n::addressinput::DEPENDENT_LOCALITY);
+ }
+ }
+}
+
} // namespace autofill
« no previous file with comments | « chrome/browser/ui/autofill/country_combobox_model.cc ('k') | chrome/browser/ui/webui/options/autofill_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698