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

Unified Diff: base/test/multiprocess_test.h

Issue 2613183002: Revert of Multiprocess test client: Android child process launcher rework. (Closed)
Patch Set: Created 3 years, 11 months 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
« no previous file with comments | « base/test/main_stub.cc ('k') | base/test/multiprocess_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/multiprocess_test.h
diff --git a/base/test/multiprocess_test.h b/base/test/multiprocess_test.h
index bf9663759e05bb0136a32f99f9ad5c8f5f50c4ad..ae4c3eb2ef75df8c33592456d7cfbcac80ea74ea 100644
--- a/base/test/multiprocess_test.h
+++ b/base/test/multiprocess_test.h
@@ -40,7 +40,7 @@
// // Do stuff involving |test_child_process| and the child process....
//
// int rv = -1;
-// ASSERT_TRUE(base::WaitForMultiprocessTestChildExit(test_child_process,
+// ASSERT_TRUE(test_child_process.WaitForExitWithTimeout(
// TestTimeouts::action_timeout(), &rv));
// EXPECT_EQ(0, rv);
// }
@@ -51,10 +51,6 @@
// // Code here runs in a child process....
// return 0;
// }
-//
-// If you need to terminate the child process, use the
-// TerminateMultiProcessTestChild method to ensure that test will work on
-// Android.
// Spawns a child process and executes the function |procname| declared using
// |MULTIPROCESS_TEST_MAIN()| or |MULTIPROCESS_TEST_MAIN_WITH_SETUP()|.
@@ -70,17 +66,24 @@
// may add any flags needed for your child process.
CommandLine GetMultiProcessTestChildBaseCommandLine();
-// Waits for the child process to exit. Returns true if the process exited
-// within |timeout| and sets |exit_code| if non null.
-bool WaitForMultiprocessTestChildExit(const Process& process,
- TimeDelta timeout,
- int* exit_code);
+#if defined(OS_ANDROID)
-// Terminates |process| with |exit_code|. If |wait| is true, this call blocks
-// until the process actually terminates.
-bool TerminateMultiProcessTestChild(const Process& process,
- int exit_code,
- bool wait);
+// Enable the alternate test child implementation which support spawning a child
+// after threads have been created. If used, this MUST be the first line of
+// main(). The main function is passed in to avoid a link-time dependency in
+// component builds.
+void InitAndroidMultiProcessTestHelper(int (*main)(int, char**));
+
+// Returns true if the current process is a test child.
+bool AndroidIsChildProcess();
+
+// Wait for a test child to exit if the alternate test child implementation is
+// being used.
+bool AndroidWaitForChildExitWithTimeout(
+ const Process& process, TimeDelta timeout, int* exit_code)
+ WARN_UNUSED_RESULT;
+
+#endif // defined(OS_ANDROID)
// MultiProcessTest ------------------------------------------------------------
« no previous file with comments | « base/test/main_stub.cc ('k') | base/test/multiprocess_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698