diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-31 02:26:40 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-31 02:26:40 +0000 |
commit | a324a45fada4feccc9175b1ca37e3cf8be99148c (patch) | |
tree | 046c897cdd5187496b019a6d4427f8201354087e /app/l10n_util_unittest.cc | |
parent | c9c6f5cbd15124457b0fe77f03fda9e4c4855f48 (diff) | |
download | chromium_src-a324a45fada4feccc9175b1ca37e3cf8be99148c.zip chromium_src-a324a45fada4feccc9175b1ca37e3cf8be99148c.tar.gz chromium_src-a324a45fada4feccc9175b1ca37e3cf8be99148c.tar.bz2 |
Revert 54418 - base: Add UnSetEnv function to EnvVarGetter API.
BUG=None
TEST=out/Debug/base_unittests --gtest_filter=EnvVarTest.UnSetEnvVar
Signed-off-by: Thiago Farina <tfarina@chromium.org>
Review URL: http://codereview.chromium.org/3043018
TBR=tfarina@chromium.org
Review URL: http://codereview.chromium.org/2847092
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54422 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/l10n_util_unittest.cc')
-rw-r--r-- | app/l10n_util_unittest.cc | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/app/l10n_util_unittest.cc b/app/l10n_util_unittest.cc index 58d0a98f..1975d6c 100644 --- a/app/l10n_util_unittest.cc +++ b/app/l10n_util_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -15,7 +15,6 @@ #include "app/test/data/resource.h" #endif #include "base/basictypes.h" -#include "base/env_var.h" #include "base/file_util.h" #include "base/path_service.h" #include "base/stl_util-inl.h" @@ -139,32 +138,30 @@ TEST_F(L10nUtilTest, GetAppLocale) { icu::Locale locale = icu::Locale::getDefault(); #if defined(OS_POSIX) && !defined(OS_CHROMEOS) - scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); - // Test the support of LANGUAGE environment variable. SetICUDefaultLocale("en-US"); - env->SetEnv("LANGUAGE", "xx:fr_CA"); + ::setenv("LANGUAGE", "xx:fr_CA", 1); EXPECT_EQ("fr", l10n_util::GetApplicationLocale(L"")); - env->SetEnv("LANGUAGE", "xx:yy:en_gb.utf-8@quot"); + ::setenv("LANGUAGE", "xx:yy:en_gb.utf-8@quot", 1); EXPECT_EQ("en-GB", l10n_util::GetApplicationLocale(L"")); - env->SetEnv("LANGUAGE", "xx:zh-hk"); + ::setenv("LANGUAGE", "xx:zh-hk", 1); EXPECT_EQ("zh-TW", l10n_util::GetApplicationLocale(L"")); // We emulate gettext's behavior here, which ignores LANG/LC_MESSAGES/LC_ALL // when LANGUAGE is specified. If no language specified in LANGUAGE is valid, // then just fallback to the default language, which is en-US for us. SetICUDefaultLocale("fr-FR"); - env->SetEnv("LANGUAGE", "xx:yy"); + ::setenv("LANGUAGE", "xx:yy", 1); EXPECT_EQ("en-US", l10n_util::GetApplicationLocale(L"")); - env->SetEnv("LANGUAGE", "/fr:zh_CN"); + ::setenv("LANGUAGE", "/fr:zh_CN", 1); EXPECT_EQ("zh-CN", l10n_util::GetApplicationLocale(L"")); // Make sure the follow tests won't be affected by LANGUAGE environment // variable. - env->UnSetEnv("LANGUAGE"); + ::unsetenv("LANGUAGE"); #endif // defined(OS_POSIX) && !defined(OS_CHROMEOS) SetICUDefaultLocale("en-US"); |