| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 CommandLine GetMultiProcessTestChildBaseCommandLine(); | 67 CommandLine GetMultiProcessTestChildBaseCommandLine(); |
| 68 | 68 |
| 69 #if defined(OS_ANDROID) | 69 #if defined(OS_ANDROID) |
| 70 | 70 |
| 71 // Enable the alternate test child implementation which support spawning a child | 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 | 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 | 73 // main(). The main function is passed in to avoid a link-time dependency in |
| 74 // component builds. | 74 // component builds. |
| 75 void InitAndroidMultiProcessTestHelper(int (*main)(int, char**)); | 75 void InitAndroidMultiProcessTestHelper(int (*main)(int, char**)); |
| 76 | 76 |
| 77 // Returns true if the current process is a test child. |
| 78 bool AndroidIsChildProcess(); |
| 79 |
| 77 // Wait for a test child to exit if the alternate test child implementation is | 80 // Wait for a test child to exit if the alternate test child implementation is |
| 78 // being used. | 81 // being used. |
| 79 bool AndroidWaitForChildExitWithTimeout( | 82 bool AndroidWaitForChildExitWithTimeout( |
| 80 const Process& process, TimeDelta timeout, int* exit_code) | 83 const Process& process, TimeDelta timeout, int* exit_code) |
| 81 WARN_UNUSED_RESULT; | 84 WARN_UNUSED_RESULT; |
| 82 | 85 |
| 83 #endif // defined(OS_ANDROID) | 86 #endif // defined(OS_ANDROID) |
| 84 | 87 |
| 85 // MultiProcessTest ------------------------------------------------------------ | 88 // MultiProcessTest ------------------------------------------------------------ |
| 86 | 89 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 // |ModifyChildCommandLine()|; make the two divergent uses more sane. | 141 // |ModifyChildCommandLine()|; make the two divergent uses more sane. |
| 139 virtual CommandLine MakeCmdLine(const std::string& procname); | 142 virtual CommandLine MakeCmdLine(const std::string& procname); |
| 140 | 143 |
| 141 private: | 144 private: |
| 142 DISALLOW_COPY_AND_ASSIGN(MultiProcessTest); | 145 DISALLOW_COPY_AND_ASSIGN(MultiProcessTest); |
| 143 }; | 146 }; |
| 144 | 147 |
| 145 } // namespace base | 148 } // namespace base |
| 146 | 149 |
| 147 #endif // BASE_TEST_MULTIPROCESS_TEST_H_ | 150 #endif // BASE_TEST_MULTIPROCESS_TEST_H_ |
| OLD | NEW |