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

Unified Diff: base/test/test_launcher.cc

Issue 17910005: Fix handling of BROWSER_WRAPPER in the test launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 6 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 | « base/test/test_launcher.h ('k') | content/public/test/test_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_launcher.cc
diff --git a/base/test/test_launcher.cc b/base/test/test_launcher.cc
index 0da8cec21cc1becda1969c9482ae3768448da666..9804ceab50b9c7cfa36065d95fa6c93f7f49aa2a 100644
--- a/base/test/test_launcher.cc
+++ b/base/test/test_launcher.cc
@@ -15,6 +15,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/process_util.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/test/test_timeouts.h"
#include "base/time.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -350,6 +351,7 @@ TestLauncherDelegate::~TestLauncherDelegate() {
}
int LaunchChildGTestProcess(const CommandLine& command_line,
+ const std::string& wrapper,
base::TimeDelta timeout,
bool* was_timeout) {
CommandLine new_command_line(command_line.GetProgram());
@@ -367,6 +369,16 @@ int LaunchChildGTestProcess(const CommandLine& command_line,
new_command_line.AppendSwitchNative((*iter).first, (*iter).second);
}
+ // Prepend wrapper after last CommandLine quasi-copy operation. CommandLine
+ // does not really support removing switches well, and trying to do that
+ // on a CommandLine with a wrapper is known to break.
+ // TODO(phajdan.jr): Give it a try to support CommandLine removing switches.
+#if defined(OS_WIN)
+ new_command_line.PrependWrapper(ASCIIToWide(wrapper));
+#elif defined(OS_POSIX)
+ new_command_line.PrependWrapper(wrapper);
+#endif
+
base::ProcessHandle process_handle;
base::LaunchOptions options;
« no previous file with comments | « base/test/test_launcher.h ('k') | content/public/test/test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698