OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 7 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 "fil", | 121 "fil", |
122 "nb", | 122 "nb", |
123 "am", | 123 "am", |
124 "ca", | 124 "ca", |
125 "ca@valencia", | 125 "ca@valencia", |
126 }; | 126 }; |
127 | 127 |
128 for (size_t i = 0; i < arraysize(filenames); ++i) { | 128 for (size_t i = 0; i < arraysize(filenames); ++i) { |
129 base::FilePath filename = new_locale_dir.AppendASCII( | 129 base::FilePath filename = new_locale_dir.AppendASCII( |
130 filenames[i] + ".pak"); | 130 filenames[i] + ".pak"); |
131 file_util::WriteFile(filename, "", 0); | 131 base::WriteFile(filename, "", 0); |
132 } | 132 } |
133 | 133 |
134 // Keep a copy of ICU's default locale before we overwrite it. | 134 // Keep a copy of ICU's default locale before we overwrite it. |
135 const std::string original_locale = base::i18n::GetConfiguredLocale(); | 135 const std::string original_locale = base::i18n::GetConfiguredLocale(); |
136 | 136 |
137 if (kPlatformHasDefaultLocale && kUseLocaleFromEnvironment) { | 137 if (kPlatformHasDefaultLocale && kUseLocaleFromEnvironment) { |
138 env.reset(base::Environment::Create()); | 138 env.reset(base::Environment::Create()); |
139 | 139 |
140 // Test the support of LANGUAGE environment variable. | 140 // Test the support of LANGUAGE environment variable. |
141 base::i18n::SetICUDefaultLocale("en-US"); | 141 base::i18n::SetICUDefaultLocale("en-US"); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("Latin")); | 474 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("Latin")); |
475 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("German")); | 475 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("German")); |
476 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("pt--BR")); | 476 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("pt--BR")); |
477 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("sl-macedonia")); | 477 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("sl-macedonia")); |
478 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("@")); | 478 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("@")); |
479 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@")); | 479 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@")); |
480 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x")); | 480 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x")); |
481 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x=")); | 481 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x=")); |
482 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@=y")); | 482 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@=y")); |
483 } | 483 } |
OLD | NEW |