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[]; |
29 extern const char kSingleProcessTestsFlag[]; | 33 extern const char kSingleProcessTestsFlag[]; |
30 extern const char kSingleProcessTestsAndChromeFlag[]; | 34 extern const char kSingleProcessTestsAndChromeFlag[]; |
31 extern const char kRunManualTestsFlag[]; | 35 extern const char kRunManualTestsFlag[]; |
32 extern const char kHelpFlag[]; | 36 extern const char kHelpFlag[]; |
37 extern const char kLaunchAsBrowser[]; | |
jam
2012/09/04 15:18:14
nit: order
phoglund_chromium
2012/09/05 09:41:05
Done.
| |
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: |
44 virtual bool Run(int argc, char** argv, int* return_code); | |
45 | |
jam
2012/09/04 15:18:14
TestLauncherDelegate is an interface for the deleg
phoglund_chromium
2012/09/05 09:41:05
Done.
| |
39 virtual std::string GetEmptyTestName() = 0; | 46 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; | 47 virtual int RunTestSuite(int argc, char** argv) = 0; |
42 virtual bool AdjustChildProcessCommandLine(CommandLine* command_line, | 48 virtual bool AdjustChildProcessCommandLine(CommandLine* command_line, |
43 const FilePath& temp_data_dir) = 0; | 49 const FilePath& temp_data_dir) = 0; |
44 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} | 50 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} |
45 virtual void PostRunMessageLoop() {} | 51 virtual void PostRunMessageLoop() {} |
46 | 52 |
47 protected: | 53 protected: |
48 virtual ~TestLauncherDelegate(); | 54 virtual ~TestLauncherDelegate(); |
55 virtual content::ContentMainDelegate* CreateContentMainDelegate() = 0; | |
jam
2012/09/04 15:18:14
... and then this would be in the public section l
phoglund_chromium
2012/09/05 09:41:05
Done.
| |
49 }; | 56 }; |
50 | 57 |
51 int LaunchTests(TestLauncherDelegate* launcher_delegate, | 58 int LaunchTests(TestLauncherDelegate* launcher_delegate, |
52 int argc, | 59 int argc, |
53 char** argv) WARN_UNUSED_RESULT; | 60 char** argv) WARN_UNUSED_RESULT; |
54 | 61 |
55 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); | 62 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); |
56 | 63 |
57 } // namespace test_launcher | 64 } // namespace test_launcher |
58 | 65 |
59 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ | 66 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ |
OLD | NEW |