Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: ui/base/l10n/l10n_util_unittest.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/imagediff/image_diff.cc ('k') | ui/base/resource/data_pack_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/imagediff/image_diff.cc ('k') | ui/base/resource/data_pack_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698