| 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 <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.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 } | 18 } |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 class ContentMainDelegate; | 21 class ContentMainDelegate; |
| 21 struct ContentMainParams; | 22 struct ContentMainParams; |
| 22 | 23 |
| 23 extern const char kEmptyTestName[]; | 24 extern const char kEmptyTestName[]; |
| 24 extern const char kHelpFlag[]; | 25 extern const char kHelpFlag[]; |
| 25 extern const char kLaunchAsBrowser[]; | 26 extern const char kLaunchAsBrowser[]; |
| 26 extern const char kRunManualTestsFlag[]; | 27 extern const char kRunManualTestsFlag[]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 39 virtual void ChildProcessLaunched(base::ProcessHandle handle, | 40 virtual void ChildProcessLaunched(base::ProcessHandle handle, |
| 40 base::ProcessId pid) = 0; | 41 base::ProcessId pid) = 0; |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 class TestLauncherDelegate { | 44 class TestLauncherDelegate { |
| 44 public: | 45 public: |
| 45 virtual int RunTestSuite(int argc, char** argv) = 0; | 46 virtual int RunTestSuite(int argc, char** argv) = 0; |
| 46 virtual bool AdjustChildProcessCommandLine( | 47 virtual bool AdjustChildProcessCommandLine( |
| 47 base::CommandLine* command_line, | 48 base::CommandLine* command_line, |
| 48 const base::FilePath& temp_data_dir) = 0; | 49 const base::FilePath& temp_data_dir) = 0; |
| 50 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} |
| 51 virtual void PostRunMessageLoop() {} |
| 49 virtual ContentMainDelegate* CreateContentMainDelegate() = 0; | 52 virtual ContentMainDelegate* CreateContentMainDelegate() = 0; |
| 50 | 53 |
| 51 // 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 |
| 52 // and options used to launch the subprocess. Additionally the client may | 55 // and options used to launch the subprocess. Additionally the client may |
| 53 // 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 |
| 54 // once the test process is launched. | 57 // once the test process is launched. |
| 55 // | 58 // |
| 56 // NOTE: this is not called if --single_process is supplied. | 59 // NOTE: this is not called if --single_process is supplied. |
| 57 virtual std::unique_ptr<TestState> PreRunTest( | 60 virtual std::unique_ptr<TestState> PreRunTest( |
| 58 base::CommandLine* command_line, | 61 base::CommandLine* command_line, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 78 int default_jobs, | 81 int default_jobs, |
| 79 int argc, | 82 int argc, |
| 80 char** argv) WARN_UNUSED_RESULT; | 83 char** argv) WARN_UNUSED_RESULT; |
| 81 | 84 |
| 82 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); | 85 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); |
| 83 ContentMainParams* GetContentMainParams(); | 86 ContentMainParams* GetContentMainParams(); |
| 84 | 87 |
| 85 } // namespace content | 88 } // namespace content |
| 86 | 89 |
| 87 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ | 90 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ |
| OLD | NEW |