| Index: base/test/launcher/test_launcher.cc
|
| diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
|
| index 4553002e320b65f3c36d73efe04a68180548bf59..c97363a4d2181ffb2fe22146febbf916925515a7 100644
|
| --- a/base/test/launcher/test_launcher.cc
|
| +++ b/base/test/launcher/test_launcher.cc
|
| @@ -61,6 +61,11 @@
|
| #include "base/win/windows_version.h"
|
| #endif
|
|
|
| +#if defined(OS_FUCHSIA)
|
| +#include <magenta/process.h>
|
| +#include <magenta/syscalls.h>
|
| +#endif
|
| +
|
| namespace base {
|
|
|
| // See https://groups.google.com/a/chromium.org/d/msg/chromium-dev/nkdTP7sstSc/uT3FaE_sgkAJ .
|
| @@ -114,7 +119,7 @@ TestLauncherTracer* GetTestLauncherTracer() {
|
| return tracer;
|
| }
|
|
|
| -#if defined(OS_POSIX)
|
| +#if defined(OS_POSIX) && !defined(OS_FUCHSIA)
|
| // Self-pipe that makes it possible to do complex shutdown handling
|
| // outside of the signal handler.
|
| int g_shutdown_pipe[2] = { -1, -1 };
|
| @@ -296,6 +301,18 @@ int LaunchChildTestProcessWithOptions(
|
| }
|
| #endif // defined(OS_WIN)
|
|
|
| +#if defined(OS_FUCHSIA)
|
| + DCHECK_EQ(new_options.job_handle, MX_HANDLE_INVALID);
|
| + if (flags & TestLauncher::USE_JOB_OBJECTS) {
|
| + mx_status_t status =
|
| + mx_job_create(mx_job_default(), 0, &new_options.job_handle);
|
| + if (status < 0) {
|
| + LOG(ERROR) << "Failed to create job object";
|
| + return -1;
|
| + }
|
| + }
|
| +#endif
|
| +
|
| #if defined(OS_LINUX)
|
| // To prevent accidental privilege sharing to an untrusted child, processes
|
| // are started with PR_SET_NO_NEW_PRIVS. Do not set that here, since this
|
| @@ -356,7 +373,7 @@ int LaunchChildTestProcessWithOptions(
|
| // to do that twice and trigger all kinds of log messages.
|
| AutoLock lock(*GetLiveProcessesLock());
|
|
|
| -#if defined(OS_POSIX)
|
| +#if defined(OS_POSIX) && !defined(OS_FUCHSIA)
|
| if (exit_code != 0) {
|
| // On POSIX, in case the test does not exit cleanly, either due to a crash
|
| // or due to it timing out, we need to clean up any child processes that
|
| @@ -524,7 +541,7 @@ bool TestLauncher::Run() {
|
| // original value.
|
| int requested_cycles = cycles_;
|
|
|
| -#if defined(OS_POSIX)
|
| +#if defined(OS_POSIX) && !defined(OS_FUCHSIA)
|
| CHECK_EQ(0, pipe(g_shutdown_pipe));
|
|
|
| struct sigaction action;
|
| @@ -679,7 +696,7 @@ void TestLauncher::OnTestFinished(const TestResult& original_result) {
|
| test_broken_count_);
|
| fflush(stdout);
|
|
|
| -#if defined(OS_POSIX)
|
| +#if defined(OS_POSIX) && !defined(OS_FUCHSIA)
|
| KillSpawnedTestProcesses();
|
| #endif // defined(OS_POSIX)
|
|
|
|
|