diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-08 13:32:51 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-08 13:32:51 +0000 |
commit | ac7264cf34b514ff94fcce9a9c7dae0704cd4e10 (patch) | |
tree | 0a3a8e68e60c68b892a82d6c3ddbf9ef8902c187 /chrome/common/logging_chrome_uitest.cc | |
parent | ae618ad90c5106ed686eedfde7c8f70f2df79b32 (diff) | |
download | chromium_src-ac7264cf34b514ff94fcce9a9c7dae0704cd4e10.zip chromium_src-ac7264cf34b514ff94fcce9a9c7dae0704cd4e10.tar.gz chromium_src-ac7264cf34b514ff94fcce9a9c7dae0704cd4e10.tar.bz2 |
base: Add SetEnv() to EnvVarGetter class and get rid of the some ifdefs.
(Note: This was a TODO)
BUG=None
TEST=included
Review URL: http://codereview.chromium.org/2843048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51840 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/logging_chrome_uitest.cc')
-rw-r--r-- | chrome/common/logging_chrome_uitest.cc | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/chrome/common/logging_chrome_uitest.cc b/chrome/common/logging_chrome_uitest.cc index 1b64cae..648aace 100644 --- a/chrome/common/logging_chrome_uitest.cc +++ b/chrome/common/logging_chrome_uitest.cc @@ -29,24 +29,14 @@ class ChromeLoggingTest : public testing::Test { if (!env->GetEnv(env_vars::kLogFileName, &environment_filename_)) environment_filename_ = ""; - // TODO(port) Add base::SetEnv() and get rid of the ifdefs. -#if defined(OS_WIN) - SetEnvironmentVariable(ASCIIToWide(env_vars::kLogFileName).c_str(), - ASCIIToWide(new_value).c_str()); -#else - setenv(env_vars::kLogFileName, new_value.c_str(), 1); -#endif + env->SetEnv(env_vars::kLogFileName, new_value); } // Restores the value of the log file nave environment variable // previously saved by SaveEnvironmentVariable(). void RestoreEnvironmentVariable() { -#if defined(OS_WIN) - SetEnvironmentVariable(ASCIIToWide(env_vars::kLogFileName).c_str(), - ASCIIToWide(environment_filename_).c_str()); -#else - setenv(env_vars::kLogFileName, environment_filename_.c_str(), 1); -#endif + scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create()); + env->SetEnv(env_vars::kLogFileName, environment_filename_); } private: |