Index: base/test/multiprocess_test.h |
diff --git a/base/test/multiprocess_test.h b/base/test/multiprocess_test.h |
index bf9663759e05bb0136a32f99f9ad5c8f5f50c4ad..e0c6022b5bc0e375a9d690e194a79f3b172faa8d 100644 |
--- a/base/test/multiprocess_test.h |
+++ b/base/test/multiprocess_test.h |
@@ -13,10 +13,22 @@ |
#include "build/build_config.h" |
#include "testing/platform_test.h" |
+#if defined(OS_ANDROID) |
+#include "base/android/scoped_java_ref.h" |
+#endif |
+ |
namespace base { |
class CommandLine; |
+struct SpawnChildResult { |
+ Process process; |
+#if defined(OS_ANDROID) |
+ base::android::ScopedJavaGlobalRef<jobject> parcelable_channel_client; |
+ base::android::ScopedJavaGlobalRef<jobject> parcelable_channel_server; |
+#endif |
+}; |
+ |
// Helpers to spawn a child for a multiprocess test and execute a designated |
// function. Use these when you already have another base class for your test |
// fixture, but you want (some) of your tests to be multiprocess (otherwise you |
@@ -33,9 +45,10 @@ class CommandLine; |
// // Maybe set some options (e.g., |start_hidden| on Windows).... |
// |
// // Start a child process and run |a_test_func|. |
-// base::Process test_child_process = |
+// SpawnChildResult result = |
// base::SpawnMultiProcessTestChild("a_test_func", command_line, |
// options); |
+// base::Process test_child_process = std::move(result.process); |
// |
// // Do stuff involving |test_child_process| and the child process.... |
// |
@@ -61,10 +74,9 @@ class CommandLine; |
// |command_line| should be as provided by |
// |GetMultiProcessTestChildBaseCommandLine()| (below), possibly with arguments |
// added. Note: On Windows, you probably want to set |options.start_hidden|. |
-Process SpawnMultiProcessTestChild( |
- const std::string& procname, |
- const CommandLine& command_line, |
- const LaunchOptions& options); |
+SpawnChildResult SpawnMultiProcessTestChild(const std::string& procname, |
+ const CommandLine& command_line, |
+ const LaunchOptions& options); |
// Gets the base command line for |SpawnMultiProcessTestChild()|. To this, you |
// may add any flags needed for your child process. |
@@ -121,13 +133,13 @@ class MultiProcessTest : public PlatformTest { |
// } |
// |
// Returns the child process. |
- Process SpawnChild(const std::string& procname); |
+ SpawnChildResult SpawnChild(const std::string& procname); |
// Run a child process using the given launch options. |
// |
// Note: On Windows, you probably want to set |options.start_hidden|. |
- Process SpawnChildWithOptions(const std::string& procname, |
- const LaunchOptions& options); |
+ SpawnChildResult SpawnChildWithOptions(const std::string& procname, |
+ const LaunchOptions& options); |
// Set up the command line used to spawn the child process. |
// Override this to add things to the command line (calling this first in the |