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

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

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 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
« no previous file with comments | « ui/base/l10n/l10n_util_collator.h ('k') | ui/base/models/list_model.h » ('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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 #endif 96 #endif
97 97
98 void SetDefaultLocaleForTest(const std::string& tag, base::Environment* env) { 98 void SetDefaultLocaleForTest(const std::string& tag, base::Environment* env) {
99 if (kUseLocaleFromEnvironment) 99 if (kUseLocaleFromEnvironment)
100 env->SetVar("LANGUAGE", tag); 100 env->SetVar("LANGUAGE", tag);
101 else 101 else
102 base::i18n::SetICUDefaultLocale(tag); 102 base::i18n::SetICUDefaultLocale(tag);
103 } 103 }
104 104
105 TEST_F(L10nUtilTest, GetAppLocale) { 105 TEST_F(L10nUtilTest, GetAppLocale) {
106 scoped_ptr<base::Environment> env; 106 std::unique_ptr<base::Environment> env;
107 // Use a temporary locale dir so we don't have to actually build the locale 107 // Use a temporary locale dir so we don't have to actually build the locale
108 // pak files for this test. 108 // pak files for this test.
109 base::ScopedPathOverride locale_dir_override(ui::DIR_LOCALES); 109 base::ScopedPathOverride locale_dir_override(ui::DIR_LOCALES);
110 base::FilePath new_locale_dir; 110 base::FilePath new_locale_dir;
111 ASSERT_TRUE(PathService::Get(ui::DIR_LOCALES, &new_locale_dir)); 111 ASSERT_TRUE(PathService::Get(ui::DIR_LOCALES, &new_locale_dir));
112 // Make fake locale files. 112 // Make fake locale files.
113 std::string filenames[] = { 113 std::string filenames[] = {
114 "en-US", 114 "en-US",
115 "en-GB", 115 "en-GB",
116 "fr", 116 "fr",
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("Latin")); 567 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("Latin"));
568 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("German")); 568 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("German"));
569 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("pt--BR")); 569 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("pt--BR"));
570 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("sl-macedonia")); 570 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("sl-macedonia"));
571 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("@")); 571 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("@"));
572 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@")); 572 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@"));
573 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x")); 573 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x"));
574 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x=")); 574 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x="));
575 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@=y")); 575 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@=y"));
576 } 576 }
OLDNEW
« no previous file with comments | « ui/base/l10n/l10n_util_collator.h ('k') | ui/base/models/list_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698