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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 | 12 |
13 class CommandLine; | 13 class CommandLine; |
14 class FilePath; | 14 class FilePath; |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class RunLoop; | 17 class RunLoop; |
18 } | 18 } |
19 | 19 |
| 20 namespace content { |
| 21 class ContentMainDelegate; |
| 22 } |
| 23 |
20 namespace test_launcher { | 24 namespace test_launcher { |
21 | 25 |
22 extern const char kEmptyTestName[]; | 26 extern const char kEmptyTestName[]; |
23 extern const char kGTestFilterFlag[]; | 27 extern const char kGTestFilterFlag[]; |
24 extern const char kGTestHelpFlag[]; | 28 extern const char kGTestHelpFlag[]; |
25 extern const char kGTestListTestsFlag[]; | 29 extern const char kGTestListTestsFlag[]; |
26 extern const char kGTestRepeatFlag[]; | 30 extern const char kGTestRepeatFlag[]; |
27 extern const char kGTestRunDisabledTestsFlag[]; | 31 extern const char kGTestRunDisabledTestsFlag[]; |
28 extern const char kGTestOutputFlag[]; | 32 extern const char kGTestOutputFlag[]; |
| 33 extern const char kLaunchAsBrowser[]; |
29 extern const char kSingleProcessTestsFlag[]; | 34 extern const char kSingleProcessTestsFlag[]; |
30 extern const char kSingleProcessTestsAndChromeFlag[]; | 35 extern const char kSingleProcessTestsAndChromeFlag[]; |
31 extern const char kRunManualTestsFlag[]; | 36 extern const char kRunManualTestsFlag[]; |
32 extern const char kHelpFlag[]; | 37 extern const char kHelpFlag[]; |
33 | 38 |
34 // Flag that causes only the kEmptyTestName test to be run. | 39 // Flag that causes only the kEmptyTestName test to be run. |
35 extern const char kWarmupFlag[]; | 40 extern const char kWarmupFlag[]; |
36 | 41 |
37 class TestLauncherDelegate { | 42 class TestLauncherDelegate { |
38 public: | 43 public: |
39 virtual std::string GetEmptyTestName() = 0; | 44 virtual std::string GetEmptyTestName() = 0; |
40 virtual bool Run(int argc, char** argv, int* return_code) = 0; | |
41 virtual int RunTestSuite(int argc, char** argv) = 0; | 45 virtual int RunTestSuite(int argc, char** argv) = 0; |
42 virtual bool AdjustChildProcessCommandLine(CommandLine* command_line, | 46 virtual bool AdjustChildProcessCommandLine(CommandLine* command_line, |
43 const FilePath& temp_data_dir) = 0; | 47 const FilePath& temp_data_dir) = 0; |
44 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} | 48 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} |
45 virtual void PostRunMessageLoop() {} | 49 virtual void PostRunMessageLoop() {} |
| 50 virtual content::ContentMainDelegate* CreateContentMainDelegate() = 0; |
46 | 51 |
47 protected: | 52 protected: |
48 virtual ~TestLauncherDelegate(); | 53 virtual ~TestLauncherDelegate(); |
49 }; | 54 }; |
50 | 55 |
51 int LaunchTests(TestLauncherDelegate* launcher_delegate, | 56 int LaunchTests(TestLauncherDelegate* launcher_delegate, |
52 int argc, | 57 int argc, |
53 char** argv) WARN_UNUSED_RESULT; | 58 char** argv) WARN_UNUSED_RESULT; |
54 | 59 |
55 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); | 60 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); |
56 | 61 |
57 } // namespace test_launcher | 62 } // namespace test_launcher |
58 | 63 |
59 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ | 64 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ |
OLD | NEW |