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

Unified Diff: chrome/common/logging_chrome_uitest.cc

Issue 2843048: base: Add SetEnv() to EnvVarGetter class and get rid of the some ifdefs. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: filename Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/shell_integration_unittest.cc ('k') | net/proxy/proxy_config_service_linux_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/logging_chrome_uitest.cc
diff --git a/chrome/common/logging_chrome_uitest.cc b/chrome/common/logging_chrome_uitest.cc
index 1b64cae7589f86ee649dc3fe09f014b836af5c68..648aaced9008e5da4d54bdf6462dcf1fad135199 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:
« no previous file with comments | « chrome/browser/shell_integration_unittest.cc ('k') | net/proxy/proxy_config_service_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698