Index: util/win/process_info_test.cc |
diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc |
index de1d5295943135b66e3c384965d74a34d5a411f8..00b5606022457fad436dfe3a08e9e5f89369b4bb 100644 |
--- a/util/win/process_info_test.cc |
+++ b/util/win/process_info_test.cc |
@@ -22,6 +22,7 @@ |
#include "build/build_config.h" |
#include "gtest/gtest.h" |
#include "test/paths.h" |
+#include "test/win/child_launcher.h" |
#include "util/file/file_io.h" |
#include "util/misc/uuid.h" |
#include "util/win/scoped_handle.h" |
@@ -128,30 +129,15 @@ void TestOtherProcess(const base::string16& directory_modification) { |
L"_process_info_test_child.exe") |
.value(); |
// TODO(scottmg): Command line escaping utility. |
- std::wstring command_line = child_test_executable + L" " + |
- started_uuid.ToString16() + L" " + |
- done_uuid.ToString16(); |
- STARTUPINFO startup_info = {0}; |
- startup_info.cb = sizeof(startup_info); |
- PROCESS_INFORMATION process_information; |
- ASSERT_TRUE(CreateProcess(child_test_executable.c_str(), |
- &command_line[0], |
- nullptr, |
- nullptr, |
- false, |
- 0, |
- nullptr, |
- nullptr, |
- &startup_info, |
- &process_information)); |
- // Take ownership of the two process handles returned. |
- ScopedKernelHANDLE process_main_thread_handle(process_information.hThread); |
- ScopedKernelHANDLE process_handle(process_information.hProcess); |
+ ChildLauncher child( |
+ child_test_executable, |
+ started_uuid.ToString16() + L" " + done_uuid.ToString16()); |
+ child.Start(); |
// Wait until the test has completed initialization. |
ASSERT_EQ(WaitForSingleObject(started.get(), INFINITE), WAIT_OBJECT_0); |
- ASSERT_TRUE(process_info.Initialize(process_information.hProcess)); |
+ ASSERT_TRUE(process_info.Initialize(child.process_handle())); |
// Tell the test it's OK to shut down now that we've read our data. |
SetEvent(done.get()); |