| 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 d131460228aaf69494c9fa3ed23b67cd24a11392..1da71602637bb4d4f8de821af078f0f0063449e7 100644
|
| --- a/mojo/edk/test/multiprocess_test_helper.h
|
| +++ b/mojo/edk/test/multiprocess_test_helper.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/test/multiprocess_test.h"
|
| #include "base/test/test_timeouts.h"
|
| #include "mojo/edk/embedder/scoped_platform_handle.h"
|
| +#include "mojo/edk/embedder/test_embedder.h"
|
| #include "testing/multiprocess_func_list.h"
|
|
|
| namespace mojo {
|
| @@ -71,6 +72,17 @@ class MultiprocessTestHelper {
|
| test_child_name##TestChildMain, \
|
| ::mojo::test::MultiprocessTestHelper::ChildSetup)
|
|
|
| +// On android, multi-process tests cannot call exec. It means that the test must
|
| +// shutdown the embedder on the forked process as it expects to be in a clean
|
| +// state.
|
| +#if defined(OS_ANDROID)
|
| +#define SHUTDOWN_EMBEDDER_ON_ANDROID() embedder::test::Shutdown()
|
| +#else
|
| +#define SHUTDOWN_EMBEDDER_ON_ANDROID() \
|
| + do { \
|
| + } while (0)
|
| +#endif
|
| +
|
| // Use this (and |WaitForChildTestShutdown()|) for the child process's "main()",
|
| // if you want to use |EXPECT_...()| or |ASSERT_...()|; it has a |void| return
|
| // type. (Note that while an |ASSERT_...()| failure will abort the test in the
|
| @@ -78,6 +90,7 @@ class MultiprocessTestHelper {
|
| #define MOJO_MULTIPROCESS_TEST_CHILD_TEST(test_child_name) \
|
| void test_child_name##TestChildTest(); \
|
| MOJO_MULTIPROCESS_TEST_CHILD_MAIN(test_child_name) { \
|
| + SHUTDOWN_EMBEDDER_ON_ANDROID(); \
|
| test_child_name##TestChildTest(); \
|
| return (::testing::Test::HasFatalFailure() || \
|
| ::testing::Test::HasNonfatalFailure()) \
|
|
|