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