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

Unified Diff: chrome/test/tab_switching/tab_switching_test.cc

Issue 3076042: Use Environment::SetVar in more places. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: rebased to ToT Created 10 years, 4 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/first_run/first_run_win.cc ('k') | chrome_frame/crash_reporting/crash_dll.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/tab_switching/tab_switching_test.cc
diff --git a/chrome/test/tab_switching/tab_switching_test.cc b/chrome/test/tab_switching/tab_switching_test.cc
index ffbc659fb332a371e01a6bba2512b229b4c4de10..1c5b7f20da6e5ce2dc78c66b57d15efbcf14e337 100644
--- a/chrome/test/tab_switching/tab_switching_test.cc
+++ b/chrome/test/tab_switching/tab_switching_test.cc
@@ -3,10 +3,12 @@
// found in the LICENSE file.
#include "base/command_line.h"
+#include "base/environment.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/platform_thread.h"
+#include "base/scoped_ptr.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_dll_resource.h"
@@ -44,12 +46,11 @@ class TabSwitchingUITest : public UITest {
log_file_name_ = browser_directory_.AppendASCII("chrome_debug.log");
// Set the log file path for the browser test.
+ scoped_ptr<base::Environment> env(base::Environment::Create());
#if defined(OS_WIN)
- SetEnvironmentVariable(UTF8ToWide(env_vars::kLogFileName).c_str(),
- log_file_name_.value().c_str());
+ env->SetVar(env_vars::kLogFileName, WideToUTF8(log_file_name_.value()));
#else
- setenv(env_vars::kLogFileName,
- log_file_name_.value().c_str(), 1);
+ env->SetVar(env_vars::kLogFileName, log_file_name_.value());
#endif
// Add the necessary arguments to Chrome's launch command for these tests.
« no previous file with comments | « chrome/browser/first_run/first_run_win.cc ('k') | chrome_frame/crash_reporting/crash_dll.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698