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

Unified Diff: services/service_manager/tests/service_manager/service_manager_unittest.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Merge Created 3 years, 5 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
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());
« no previous file with comments | « services/service_manager/runner/host/service_process_launcher.cc ('k') | services/service_manager/tests/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698