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

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: Rebase. Created 4 years, 7 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 test child implementation is
78 // being used.
79 bool AndroidWaitForChildExitWithTimeout(
80 const Process& process, TimeDelta timeout, int* exit_code)
81 WARN_UNUSED_RESULT;
82
83 #endif // defined(OS_ANDROID)
84
69 // MultiProcessTest ------------------------------------------------------------ 85 // MultiProcessTest ------------------------------------------------------------
70 86
71 // A MultiProcessTest is a test class which makes it easier to 87 // A MultiProcessTest is a test class which makes it easier to
72 // write a test which requires code running out of process. 88 // write a test which requires code running out of process.
73 // 89 //
74 // To create a multiprocess test simply follow these steps: 90 // To create a multiprocess test simply follow these steps:
75 // 91 //
76 // 1) Derive your test from MultiProcessTest. Example: 92 // 1) Derive your test from MultiProcessTest. Example:
77 // 93 //
78 // class MyTest : public MultiProcessTest { 94 // 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. 138 // |ModifyChildCommandLine()|; make the two divergent uses more sane.
123 virtual CommandLine MakeCmdLine(const std::string& procname); 139 virtual CommandLine MakeCmdLine(const std::string& procname);
124 140
125 private: 141 private:
126 DISALLOW_COPY_AND_ASSIGN(MultiProcessTest); 142 DISALLOW_COPY_AND_ASSIGN(MultiProcessTest);
127 }; 143 };
128 144
129 } // namespace base 145 } // namespace base
130 146
131 #endif // BASE_TEST_MULTIPROCESS_TEST_H_ 147 #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