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

Side by Side Diff: chrome/test/chromedriver/chrome_launcher.cc

Issue 22750002: Move AlterEnvironment to base/environment.h, implement on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/test/chromedriver/chrome_launcher.h" 5 #include "chrome/test/chromedriver/chrome_launcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 &command, 220 &command,
221 &user_data_dir, 221 &user_data_dir,
222 &extension_dir, 222 &extension_dir,
223 &extension_bg_pages); 223 &extension_bg_pages);
224 if (status.IsError()) 224 if (status.IsError())
225 return status; 225 return status;
226 226
227 base::LaunchOptions options; 227 base::LaunchOptions options;
228 228
229 #if !defined(OS_WIN) 229 #if !defined(OS_WIN)
230 base::EnvironmentVector environ; 230 if (!capabilities.log_path.empty())
231 if (!capabilities.log_path.empty()) { 231 options.environ["CHROME_LOG_FILE"] = capabilities.log_path;
232 environ.push_back(
233 base::EnvironmentVector::value_type("CHROME_LOG_FILE",
234 capabilities.log_path));
235 options.environ = &environ;
236 }
237 if (capabilities.detach) 232 if (capabilities.detach)
238 options.new_process_group = true; 233 options.new_process_group = true;
239 #endif 234 #endif
240 235
241 #if defined(OS_WIN) 236 #if defined(OS_WIN)
242 std::string command_string = base::WideToUTF8(command.GetCommandLineString()); 237 std::string command_string = base::WideToUTF8(command.GetCommandLineString());
243 #else 238 #else
244 std::string command_string = command.GetCommandLineString(); 239 std::string command_string = command.GetCommandLineString();
245 #endif 240 #endif
246 log->AddEntry(Log::kLog, "Launching chrome: " + command_string); 241 log->AddEntry(Log::kLog, "Launching chrome: " + command_string);
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 // Write empty "First Run" file, otherwise Chrome will wipe the default 594 // Write empty "First Run" file, otherwise Chrome will wipe the default
600 // profile that was written. 595 // profile that was written.
601 if (file_util::WriteFile( 596 if (file_util::WriteFile(
602 user_data_dir.AppendASCII("First Run"), "", 0) != 0) { 597 user_data_dir.AppendASCII("First Run"), "", 0) != 0) {
603 return Status(kUnknownError, "failed to write first run file"); 598 return Status(kUnknownError, "failed to write first run file");
604 } 599 }
605 return Status(kOk); 600 return Status(kOk);
606 } 601 }
607 602
608 } // namespace internal 603 } // namespace internal
OLDNEW
« no previous file with comments | « chrome/browser/platform_util_linux.cc ('k') | chrome/utility/importer/firefox_importer_unittest_utils_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698