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

Side by Side Diff: base/test/multiprocess_test.h

Issue 1910233003: Implement a new child test helper for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inject main(). Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/test/multiprocess_test_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TEST_MULTIPROCESS_TEST_H_ 5 #ifndef BASE_TEST_MULTIPROCESS_TEST_H_
6 #define BASE_TEST_MULTIPROCESS_TEST_H_ 6 #define BASE_TEST_MULTIPROCESS_TEST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // added. Note: On Windows, you probably want to set |options.start_hidden|. 59 // added. Note: On Windows, you probably want to set |options.start_hidden|.
60 Process SpawnMultiProcessTestChild( 60 Process SpawnMultiProcessTestChild(
61 const std::string& procname, 61 const std::string& procname,
62 const CommandLine& command_line, 62 const CommandLine& command_line,
63 const LaunchOptions& options); 63 const LaunchOptions& options);
64 64
65 // Gets the base command line for |SpawnMultiProcessTestChild()|. To this, you 65 // Gets the base command line for |SpawnMultiProcessTestChild()|. To this, you
66 // may add any flags needed for your child process. 66 // may add any flags needed for your child process.
67 CommandLine GetMultiProcessTestChildBaseCommandLine(); 67 CommandLine GetMultiProcessTestChildBaseCommandLine();
68 68
69 #if defined(OS_ANDROID)
70
71 // Enable the alternate test child implementation which support spawning a child
72 // after threads have been created. If used, this MUST be the first line of
73 // main(). The main function is passed in to avoid a link-time dependency in
74 // component builds.
75 void InitAndroidMultiProcessTestHelper(int (*main)(int, char**));
76
77 // Wait for a test child to exit if the alternate tech child implementation is
Paweł Hajdan Jr. 2016/04/26 20:19:43 What's "alternate tech child"? Should "tech" chang
Anand Mistry (off Chromium) 2016/04/26 23:50:38 Done.
78 // being used.
79 bool AndroidWaitForChildExitWithTimeout(
Paweł Hajdan Jr. 2016/04/26 20:19:43 nit: WARN_UNUSED_RESULT
Anand Mistry (off Chromium) 2016/04/26 23:50:39 Done.
80 const Process& process, TimeDelta timeout, int* exit_code);
81
82 #endif
Paweł Hajdan Jr. 2016/04/26 20:19:43 nit: // defined(OS_ANDROID)
Anand Mistry (off Chromium) 2016/04/26 23:50:39 Done.
83
69 // MultiProcessTest ------------------------------------------------------------ 84 // MultiProcessTest ------------------------------------------------------------
70 85
71 // A MultiProcessTest is a test class which makes it easier to 86 // A MultiProcessTest is a test class which makes it easier to
72 // write a test which requires code running out of process. 87 // write a test which requires code running out of process.
73 // 88 //
74 // To create a multiprocess test simply follow these steps: 89 // To create a multiprocess test simply follow these steps:
75 // 90 //
76 // 1) Derive your test from MultiProcessTest. Example: 91 // 1) Derive your test from MultiProcessTest. Example:
77 // 92 //
78 // class MyTest : public MultiProcessTest { 93 // class MyTest : public MultiProcessTest {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // |ModifyChildCommandLine()|; make the two divergent uses more sane. 137 // |ModifyChildCommandLine()|; make the two divergent uses more sane.
123 virtual CommandLine MakeCmdLine(const std::string& procname); 138 virtual CommandLine MakeCmdLine(const std::string& procname);
124 139
125 private: 140 private:
126 DISALLOW_COPY_AND_ASSIGN(MultiProcessTest); 141 DISALLOW_COPY_AND_ASSIGN(MultiProcessTest);
127 }; 142 };
128 143
129 } // namespace base 144 } // namespace base
130 145
131 #endif // BASE_TEST_MULTIPROCESS_TEST_H_ 146 #endif // BASE_TEST_MULTIPROCESS_TEST_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/multiprocess_test_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698