OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "components/autofill/core/browser/autofill_country.h" | 10 #include "components/autofill/core/browser/autofill_country.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 // Test mapping all country codes to country names. | 55 // Test mapping all country codes to country names. |
56 TEST(AutofillCountryTest, AllCountryCodesHaveCountryName) { | 56 TEST(AutofillCountryTest, AllCountryCodesHaveCountryName) { |
57 std::set<std::string> expected_failures; | 57 std::set<std::string> expected_failures; |
58 #if defined(ANDROID) | 58 #if defined(ANDROID) |
59 if (base::android::BuildInfo::GetInstance()->sdk_int() < | 59 if (base::android::BuildInfo::GetInstance()->sdk_int() < |
60 base::android::SDK_VERSION_KITKAT) { | 60 base::android::SDK_VERSION_KITKAT) { |
61 expected_failures.insert("BQ"); | 61 expected_failures.insert("BQ"); |
62 expected_failures.insert("SS"); | 62 expected_failures.insert("SS"); |
| 63 expected_failures.insert("XK"); |
63 } | 64 } |
64 #endif | 65 #endif |
65 const std::vector<std::string>& country_codes = | 66 const std::vector<std::string>& country_codes = |
66 CountryDataMap::GetInstance()->country_codes(); | 67 CountryDataMap::GetInstance()->country_codes(); |
67 for (const std::string& country_code : country_codes) { | 68 for (const std::string& country_code : country_codes) { |
68 if (base::ContainsKey(expected_failures, country_code)) | 69 if (base::ContainsKey(expected_failures, country_code)) |
69 continue; | 70 continue; |
70 SCOPED_TRACE("Country code '" + country_code + "' should have a name."); | 71 SCOPED_TRACE("Country code '" + country_code + "' should have a name."); |
71 EXPECT_NE(ASCIIToUTF16(country_code), | 72 EXPECT_NE(ASCIIToUTF16(country_code), |
72 AutofillCountry(country_code, "en").name()); | 73 AutofillCountry(country_code, "en").name()); |
73 } | 74 } |
74 } | 75 } |
75 | 76 |
76 } // namespace autofill | 77 } // namespace autofill |
OLD | NEW |