| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/test/launcher/test_launcher.h" | 12 #include "base/test/launcher/test_launcher.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class CommandLine; | 15 class CommandLine; |
| 16 class FilePath; | 16 class FilePath; |
| 17 class RunLoop; | 17 class RunLoop; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 class ContentMainDelegate; | 21 class ContentMainDelegate; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 50 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} | 50 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} |
| 51 virtual void PostRunMessageLoop() {} | 51 virtual void PostRunMessageLoop() {} |
| 52 virtual ContentMainDelegate* CreateContentMainDelegate() = 0; | 52 virtual ContentMainDelegate* CreateContentMainDelegate() = 0; |
| 53 | 53 |
| 54 // Called prior to running each test. The delegate may alter the CommandLine | 54 // Called prior to running each test. The delegate may alter the CommandLine |
| 55 // and options used to launch the subprocess. Additionally the client may | 55 // and options used to launch the subprocess. Additionally the client may |
| 56 // return a TestState that is destroyed once the test completes as well as | 56 // return a TestState that is destroyed once the test completes as well as |
| 57 // once the test process is launched. | 57 // once the test process is launched. |
| 58 // | 58 // |
| 59 // NOTE: this is not called if --single_process is supplied. | 59 // NOTE: this is not called if --single_process is supplied. |
| 60 virtual scoped_ptr<TestState> PreRunTest( | 60 virtual std::unique_ptr<TestState> PreRunTest( |
| 61 base::CommandLine* command_line, | 61 base::CommandLine* command_line, |
| 62 base::TestLauncher::LaunchOptions* test_launch_options); | 62 base::TestLauncher::LaunchOptions* test_launch_options); |
| 63 | 63 |
| 64 // Allows a TestLauncherDelegate to adjust the number of |default_jobs| used | 64 // Allows a TestLauncherDelegate to adjust the number of |default_jobs| used |
| 65 // when --test-launcher-jobs isn't specified on the command-line. | 65 // when --test-launcher-jobs isn't specified on the command-line. |
| 66 virtual void AdjustDefaultParallelJobs(int* default_jobs) {} | 66 virtual void AdjustDefaultParallelJobs(int* default_jobs) {} |
| 67 | 67 |
| 68 // Called prior to returning from LaunchTests(). Gives the delegate a chance | 68 // Called prior to returning from LaunchTests(). Gives the delegate a chance |
| 69 // to do cleanup before state created by TestLauncher has been destroyed (such | 69 // to do cleanup before state created by TestLauncher has been destroyed (such |
| 70 // as the AtExitManager). | 70 // as the AtExitManager). |
| (...skipping 10 matching lines...) Expand all Loading... |
| 81 int default_jobs, | 81 int default_jobs, |
| 82 int argc, | 82 int argc, |
| 83 char** argv) WARN_UNUSED_RESULT; | 83 char** argv) WARN_UNUSED_RESULT; |
| 84 | 84 |
| 85 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); | 85 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); |
| 86 ContentMainParams* GetContentMainParams(); | 86 ContentMainParams* GetContentMainParams(); |
| 87 | 87 |
| 88 } // namespace content | 88 } // namespace content |
| 89 | 89 |
| 90 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ | 90 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ |
| OLD | NEW |