| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LAUNCHER_TEST_LAUNCHER_H_ | 5 #ifndef BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
| 6 #define BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ | 6 #define BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // processes. | 82 // processes. |
| 83 USE_JOB_OBJECTS = (1 << 0), | 83 USE_JOB_OBJECTS = (1 << 0), |
| 84 | 84 |
| 85 // Allows breakaway from job on Windows. May result in some child processes | 85 // Allows breakaway from job on Windows. May result in some child processes |
| 86 // not being properly terminated after launcher dies if these processes | 86 // not being properly terminated after launcher dies if these processes |
| 87 // fail to cooperate. | 87 // fail to cooperate. |
| 88 ALLOW_BREAKAWAY_FROM_JOB = (1 << 1), | 88 ALLOW_BREAKAWAY_FROM_JOB = (1 << 1), |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 struct LaunchOptions { | 91 struct LaunchOptions { |
| 92 LaunchOptions(); |
| 93 LaunchOptions(const LaunchOptions& other); |
| 94 ~LaunchOptions(); |
| 95 |
| 92 int flags = 0; | 96 int flags = 0; |
| 97 // These mirror values in base::LaunchOptions, see it for details. |
| 93 #if defined(OS_WIN) | 98 #if defined(OS_WIN) |
| 94 // These mirror values in base::LaunchOptions, see it for details. | 99 base::LaunchOptions::Inherit inherit_mode = |
| 95 HandlesToInheritVector* handles_to_inherit = nullptr; | 100 base::LaunchOptions::Inherit::kSpecific; |
| 96 bool inherit_handles = false; | 101 base::HandlesToInheritVector handles_to_inherit; |
| 97 #elif defined(OS_POSIX) | 102 #elif defined(OS_POSIX) |
| 98 const FileHandleMappingVector* fds_to_remap = nullptr; | 103 FileHandleMappingVector fds_to_remap; |
| 99 #endif | 104 #endif |
| 100 }; | 105 }; |
| 101 | 106 |
| 102 // Constructor. |parallel_jobs| is the limit of simultaneous parallel test | 107 // Constructor. |parallel_jobs| is the limit of simultaneous parallel test |
| 103 // jobs. | 108 // jobs. |
| 104 TestLauncher(TestLauncherDelegate* launcher_delegate, size_t parallel_jobs); | 109 TestLauncher(TestLauncherDelegate* launcher_delegate, size_t parallel_jobs); |
| 105 ~TestLauncher(); | 110 ~TestLauncher(); |
| 106 | 111 |
| 107 // Runs the launcher. Must be called at most once. | 112 // Runs the launcher. Must be called at most once. |
| 108 bool Run() WARN_UNUSED_RESULT; | 113 bool Run() WARN_UNUSED_RESULT; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 DISALLOW_COPY_AND_ASSIGN(TestLauncher); | 249 DISALLOW_COPY_AND_ASSIGN(TestLauncher); |
| 245 }; | 250 }; |
| 246 | 251 |
| 247 // Extract part from |full_output| that applies to |result|. | 252 // Extract part from |full_output| that applies to |result|. |
| 248 std::string GetTestOutputSnippet(const TestResult& result, | 253 std::string GetTestOutputSnippet(const TestResult& result, |
| 249 const std::string& full_output); | 254 const std::string& full_output); |
| 250 | 255 |
| 251 } // namespace base | 256 } // namespace base |
| 252 | 257 |
| 253 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ | 258 #endif // BASE_TEST_LAUNCHER_TEST_LAUNCHER_H_ |
| OLD | NEW |