Commit 261d69bf authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Map China to "China mainland" for autofill profile.

Since iOS 12.2, China is called China mainland.
This prevents setting country to China when editing profile.

Bug: 946891
Change-Id: Ic38a3a8e7b512b817a2b509e8d5a03e0a14b6bed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1890041Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarParastoo Geranmayeh <parastoog@google.com>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711329}
parent 0a4d8c8f
......@@ -14,6 +14,7 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "components/autofill/core/browser/geo/country_data.h"
#include "components/autofill/core/common/autofill_l10n_util.h"
#include "third_party/icu/source/common/unicode/unistr.h"
......@@ -77,6 +78,11 @@ std::map<std::string, std::string> GetCommonNames() {
common_names.insert(std::make_pair("UK", "GB"));
common_names.insert(std::make_pair("BRASIL", "BR"));
common_names.insert(std::make_pair("DEUTSCHLAND", "DE"));
#if defined(OS_IOS)
// iOS uses the Foundation API to get the localized display name, in which
// "China" is named "Chine mainland".
common_names.insert(std::make_pair("CHINA", "CN"));
#endif
return common_names;
}
......
......@@ -58,7 +58,7 @@ struct UserTypedCountryExpectedResultPair {
const UserTypedCountryExpectedResultPair kCountryTests[] = {
{@"Brasil", @"Brazil"},
{@"China", @"China"},
{@"China", @"China mainland"},
{@"DEUTSCHLAND", @"Germany"},
{@"GREAT BRITAIN", @"United Kingdom"},
{@"IN", @"India"},
......@@ -166,11 +166,6 @@ id<GREYMatcher> NavigationBarEditButton() {
// Test that editing country names is followed by validating the value and
// replacing it with a canonical one.
- (void)testAutofillProfileEditing {
// TODO (crbug.com/946891) Re-enable once fixed on iOS12.2
if (base::ios::IsRunningOnOrLater(12, 2, 0)) {
EARL_GREY_TEST_DISABLED(@"Disabled on iOS 12,2.");
}
[AutofillAppInterface saveExampleProfile];
[self openEditProfile:kProfileLabel];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment