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; |