Index: mojo/edk/test/multiprocess_test_helper.h |
diff --git a/mojo/edk/test/multiprocess_test_helper.h b/mojo/edk/test/multiprocess_test_helper.h |
index 203eb117445b89381da8feb8317953b59ba0be07..689b0ecab5bd83ad1901612a6e41dadea137c14b 100644 |
--- a/mojo/edk/test/multiprocess_test_helper.h |
+++ b/mojo/edk/test/multiprocess_test_helper.h |
@@ -27,13 +27,23 @@ class MultiprocessTestHelper { |
public: |
using HandlerCallback = base::Callback<void(ScopedMessagePipeHandle)>; |
+ enum class LaunchType { |
+ // Launch the child process as a child in the mojo system. |
+ CHILD, |
+ |
+ // Launch the child process as an unrelated peer process in the mojo system. |
+ PEER, |
+ }; |
+ |
MultiprocessTestHelper(); |
~MultiprocessTestHelper(); |
// Start a child process and run the "main" function "named" |test_child_name| |
// declared using |MOJO_MULTIPROCESS_TEST_CHILD_MAIN()| or |
// |MOJO_MULTIPROCESS_TEST_CHILD_TEST()| (below). |
- ScopedMessagePipeHandle StartChild(const std::string& test_child_name); |
+ ScopedMessagePipeHandle StartChild( |
+ const std::string& test_child_name, |
+ LaunchType launch_type = LaunchType::CHILD); |
// Like |StartChild()|, but appends an extra switch (with ASCII value) to the |
// command line. (The switch must not already be present in the default |
@@ -41,7 +51,8 @@ class MultiprocessTestHelper { |
ScopedMessagePipeHandle StartChildWithExtraSwitch( |
const std::string& test_child_name, |
const std::string& switch_string, |
- const std::string& switch_value); |
+ const std::string& switch_value, |
+ LaunchType launch_type); |
void set_process_error_callback(const ProcessErrorCallback& callback) { |
process_error_callback_ = callback; |
@@ -69,7 +80,7 @@ class MultiprocessTestHelper { |
static int RunClientTestMain(const base::Callback<void(MojoHandle)>& main); |
// For use (and only valid) in the child process: |
- static std::string primordial_pipe_token; |
+ static mojo::ScopedMessagePipeHandle primordial_pipe; |
private: |
// Valid after |StartChild()| and before |WaitForChildShutdown()|. |