OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/autofill/autofill_dialog_i18n_input.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_i18n_input.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "components/autofill/core/browser/field_types.h" | 9 #include "components/autofill/core/browser/field_types.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre
ss_ui.h" |
11 | 12 |
12 namespace autofill { | 13 namespace autofill { |
13 namespace i18ninput { | 14 namespace i18ninput { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 const size_t kNumberOfAddressLinesUS = 7; | 18 const size_t kNumberOfAddressLinesUS = 7; |
18 | 19 |
19 } // namespace | 20 } // namespace |
20 | 21 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 68 } |
68 | 69 |
69 TEST(AutofillDialogI18nInput, IvoryCoastNoStreetLine2) { | 70 TEST(AutofillDialogI18nInput, IvoryCoastNoStreetLine2) { |
70 DetailInputs inputs; | 71 DetailInputs inputs; |
71 BuildAddressInputs(common::ADDRESS_TYPE_SHIPPING, "CI", &inputs); | 72 BuildAddressInputs(common::ADDRESS_TYPE_SHIPPING, "CI", &inputs); |
72 for (size_t i = 0; i < inputs.size(); ++i) { | 73 for (size_t i = 0; i < inputs.size(); ++i) { |
73 EXPECT_NE(ADDRESS_HOME_LINE2, inputs[i].type); | 74 EXPECT_NE(ADDRESS_HOME_LINE2, inputs[i].type); |
74 } | 75 } |
75 } | 76 } |
76 | 77 |
| 78 TEST(AutofillDialogI18nInput, FullySupportedCountries) { |
| 79 const std::vector<std::string>& regions = |
| 80 ::i18n::addressinput::GetRegionCodes(); |
| 81 for (size_t i = 0; i < regions.size(); ++i) { |
| 82 bool should_be_supported = !(regions[i] == "KR" || regions[i] == "CN"); |
| 83 EXPECT_EQ(should_be_supported, CountryIsFullySupported(regions[i])); |
| 84 } |
| 85 } |
| 86 |
77 } // namespace i18ninput | 87 } // namespace i18ninput |
78 } // namespace autofill | 88 } // namespace autofill |
OLD | NEW |