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

Unified Diff: mojo/edk/test/run_all_unittests.cc

Issue 2549363004: Multiprocess test client: Android child process launcher rework. (Closed)
Patch Set: Fixed tests Created 4 years 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
Index: mojo/edk/test/run_all_unittests.cc
diff --git a/mojo/edk/test/run_all_unittests.cc b/mojo/edk/test/run_all_unittests.cc
index cd6b241d605b05c6b8982303a3fa8e8a51ddaff3..1a8193875ece55539157f9d3963797d657023f6a 100644
--- a/mojo/edk/test/run_all_unittests.cc
+++ b/mojo/edk/test/run_all_unittests.cc
@@ -17,6 +17,16 @@
#include "mojo/public/tests/test_support_private.h"
#include "testing/gtest/include/gtest/gtest.h"
+#if defined(OS_ANDROID)
+#include "base/test/android/android_main_function_thunk.h"
+
+int main(int argc, char** argv);
+namespace {
+// Needed for multiprocess tests to find the main function.
+base::android::AndroidMainFunctionThunk main_thunk(&main);
Ken Rockot(use gerrit already) 2016/12/12 22:23:08 Unfortunately I'm reminded that use of non-constex
Jay Civelli 2016/12/13 18:23:26 Per our discussion, I created a main_stub and made
+}
+#endif
+
int main(int argc, char** argv) {
#if !defined(OS_ANDROID)
// Silence death test thread warnings on Linux. We can afford to run our death
@@ -26,10 +36,6 @@ int main(int argc, char** argv) {
testing::GTEST_FLAG(death_test_style) = "threadsafe";
#endif
#if defined(OS_ANDROID)
- // Enable the alternate test child implementation. This is needed because Mojo
- // tests need to spawn test children after initialising the Mojo system.
- base::InitAndroidMultiProcessTestHelper(main);
-
// On android, the test framework has a signal handler that will print a
// [ CRASH ] line when the application crashes. This breaks death test has the
// test runner will consider the death of the child process a test failure.

Powered by Google App Engine
This is Rietveld 408576698