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 "components/autofill/core/browser/field_types.h" | 7 #include "components/autofill/core/browser/field_types.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre
ss_ui.h" | 9 #include "third_party/libaddressinput/chromium/cpp/include/libaddressinput/addre
ss_ui.h" |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 DetailInputs inputs; | 67 DetailInputs inputs; |
68 std::string language_code; | 68 std::string language_code; |
69 BuildAddressInputs(common::ADDRESS_TYPE_SHIPPING, "CI", &inputs, | 69 BuildAddressInputs(common::ADDRESS_TYPE_SHIPPING, "CI", &inputs, |
70 &language_code); | 70 &language_code); |
71 for (size_t i = 0; i < inputs.size(); ++i) { | 71 for (size_t i = 0; i < inputs.size(); ++i) { |
72 EXPECT_NE(ADDRESS_HOME_LINE2, inputs[i].type); | 72 EXPECT_NE(ADDRESS_HOME_LINE2, inputs[i].type); |
73 } | 73 } |
74 EXPECT_EQ("fr", language_code); | 74 EXPECT_EQ("fr", language_code); |
75 } | 75 } |
76 | 76 |
77 TEST(AutofillDialogI18nInput, FullySupportedCountries) { | |
78 const std::vector<std::string>& regions = | |
79 ::i18n::addressinput::GetRegionCodes(); | |
80 for (size_t i = 0; i < regions.size(); ++i) { | |
81 bool should_be_supported = !(regions[i] == "KR" || regions[i] == "CN"); | |
82 EXPECT_EQ(should_be_supported, CountryIsFullySupported(regions[i])); | |
83 } | |
84 } | |
85 | |
86 } // namespace i18ninput | 77 } // namespace i18ninput |
87 } // namespace autofill | 78 } // namespace autofill |
OLD | NEW |