| Index: base/test/multiprocess_test_android.cc
|
| diff --git a/base/test/multiprocess_test_android.cc b/base/test/multiprocess_test_android.cc
|
| index c74f013da1cacc0ca292de356c5ad746c08c5b31..a58968de87ecb6c70cfe7387d214778f6c62c3fa 100644
|
| --- a/base/test/multiprocess_test_android.cc
|
| +++ b/base/test/multiprocess_test_android.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/base_switches.h"
|
| #include "base/command_line.h"
|
| #include "base/logging.h"
|
| +#include "jni/LaunchClientResult_jni.h"
|
| #include "jni/MainReturnCodeResult_jni.h"
|
| #include "jni/MultiprocessTestClientLauncher_jni.h"
|
|
|
| @@ -25,9 +26,10 @@ namespace base {
|
| // - All options except |fds_to_remap| are ignored.
|
| //
|
| // NOTE: This MUST NOT run on the main thread of the NativeTest application.
|
| -Process SpawnMultiProcessTestChild(const std::string& procname,
|
| - const CommandLine& base_command_line,
|
| - const LaunchOptions& options) {
|
| +SpawnChildResult SpawnMultiProcessTestChild(
|
| + const std::string& procname,
|
| + const CommandLine& base_command_line,
|
| + const LaunchOptions& options) {
|
| JNIEnv* env = android::AttachCurrentThread();
|
| DCHECK(env);
|
|
|
| @@ -52,9 +54,18 @@ Process SpawnMultiProcessTestChild(const std::string& procname,
|
|
|
| android::ScopedJavaLocalRef<jobjectArray> j_argv =
|
| android::ToJavaArrayOfStrings(env, command_line.argv());
|
| - jint pid = android::Java_MultiprocessTestClientLauncher_launchClient(
|
| - env, android::GetApplicationContext(), j_argv, fds);
|
| - return Process(pid);
|
| + android::ScopedJavaLocalRef<jobject> launch_result =
|
| + android::Java_MultiprocessTestClientLauncher_launchClient(
|
| + env, android::GetApplicationContext(), j_argv, fds);
|
| +
|
| + SpawnChildResult result;
|
| + result.process = Process(Java_LaunchClientResult_getPid(env, launch_result));
|
| + result.parcelable_channel_client.Reset(
|
| + Java_LaunchClientResult_getParcelableChannelClient(env, launch_result));
|
| + result.parcelable_channel_server.Reset(
|
| + Java_LaunchClientResult_getParcelableChannelServer(env, launch_result));
|
| +
|
| + return result;
|
| }
|
|
|
| bool WaitForMultiprocessTestChildExit(const Process& process,
|
|
|