Index: services/service_manager/tests/service_manager/service_manager_unittest.cc |
diff --git a/services/service_manager/tests/service_manager/service_manager_unittest.cc b/services/service_manager/tests/service_manager/service_manager_unittest.cc |
index b1abfe527a5250ef9dcbf422c5efcb7fb3b6ba92..01ee19596da0d6e6b59a5577ec3600bfbe9cee48 100644 |
--- a/services/service_manager/tests/service_manager/service_manager_unittest.cc |
+++ b/services/service_manager/tests/service_manager/service_manager_unittest.cc |
@@ -20,6 +20,7 @@ |
#include "base/process/process.h" |
#include "base/process/process_handle.h" |
#include "base/run_loop.h" |
+#include "build/build_config.h" |
#include "mojo/edk/embedder/embedder.h" |
#include "mojo/edk/embedder/outgoing_broker_client_invitation.h" |
#include "mojo/edk/embedder/platform_channel_pair.h" |
@@ -236,9 +237,14 @@ class ServiceManagerTest : public test::ServiceTest, |
// Create the channel to be shared with the target process. Pass one end |
// on the command line. |
mojo::edk::PlatformChannelPair platform_channel_pair; |
- mojo::edk::HandlePassingInformation handle_passing_info; |
+ base::LaunchOptions options; |
+#if defined(OS_WIN) |
+ platform_channel_pair.PrepareToPassClientHandleToChildProcess( |
+ &child_command_line, &options.handles_to_inherit); |
+#else |
platform_channel_pair.PrepareToPassClientHandleToChildProcess( |
- &child_command_line, &handle_passing_info); |
+ &child_command_line, &options.fds_to_remap); |
+#endif |
mojo::edk::OutgoingBrokerClientInvitation invitation; |
service_manager::mojom::ServicePtr client = |
@@ -254,12 +260,6 @@ class ServiceManagerTest : public test::ServiceTest, |
test_api.SetStartServiceCallback(base::Bind( |
&ServiceManagerTest::OnConnectionCompleted, base::Unretained(this))); |
- base::LaunchOptions options; |
-#if defined(OS_WIN) |
- options.handles_to_inherit = &handle_passing_info; |
-#elif defined(OS_POSIX) |
- options.fds_to_remap = &handle_passing_info; |
-#endif |
target_ = base::LaunchProcess(child_command_line, options); |
DCHECK(target_.IsValid()); |
receiver->SetPID(target_.Pid()); |