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