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

Unified Diff: mojo/edk/test/multiprocess_test_helper.h

Issue 2227553002: Support mojo connections between unrelated peer processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « mojo/edk/test/mojo_test_base.cc ('k') | mojo/edk/test/multiprocess_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()|.
« no previous file with comments | « mojo/edk/test/mojo_test_base.cc ('k') | mojo/edk/test/multiprocess_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698