| 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 namespace base { |
| 13 class CommandLine; | 14 class CommandLine; |
| 14 | |
| 15 namespace base { | |
| 16 class FilePath; | 15 class FilePath; |
| 17 class RunLoop; | 16 class RunLoop; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 class ContentMainDelegate; | 20 class ContentMainDelegate; |
| 22 | 21 |
| 23 extern const char kEmptyTestName[]; | 22 extern const char kEmptyTestName[]; |
| 24 extern const char kHelpFlag[]; | 23 extern const char kHelpFlag[]; |
| 25 extern const char kLaunchAsBrowser[]; | 24 extern const char kLaunchAsBrowser[]; |
| 26 extern const char kRunManualTestsFlag[]; | 25 extern const char kRunManualTestsFlag[]; |
| 27 extern const char kSingleProcessTestsFlag[]; | 26 extern const char kSingleProcessTestsFlag[]; |
| 28 | 27 |
| 29 // Flag that causes only the kEmptyTestName test to be run. | 28 // Flag that causes only the kEmptyTestName test to be run. |
| 30 extern const char kWarmupFlag[]; | 29 extern const char kWarmupFlag[]; |
| 31 | 30 |
| 32 class TestLauncherDelegate { | 31 class TestLauncherDelegate { |
| 33 public: | 32 public: |
| 34 virtual int RunTestSuite(int argc, char** argv) = 0; | 33 virtual int RunTestSuite(int argc, char** argv) = 0; |
| 35 virtual bool AdjustChildProcessCommandLine( | 34 virtual bool AdjustChildProcessCommandLine( |
| 36 CommandLine* command_line, | 35 base::CommandLine* command_line, |
| 37 const base::FilePath& temp_data_dir) = 0; | 36 const base::FilePath& temp_data_dir) = 0; |
| 38 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} | 37 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {} |
| 39 virtual void PostRunMessageLoop() {} | 38 virtual void PostRunMessageLoop() {} |
| 40 virtual ContentMainDelegate* CreateContentMainDelegate() = 0; | 39 virtual ContentMainDelegate* CreateContentMainDelegate() = 0; |
| 41 | 40 |
| 42 // Allows a TestLauncherDelegate to adjust the number of |default_jobs| used | 41 // Allows a TestLauncherDelegate to adjust the number of |default_jobs| used |
| 43 // when --test-launcher-jobs isn't specified on the command-line. | 42 // when --test-launcher-jobs isn't specified on the command-line. |
| 44 virtual void AdjustDefaultParallelJobs(int* default_jobs) {} | 43 virtual void AdjustDefaultParallelJobs(int* default_jobs) {} |
| 45 | 44 |
| 46 protected: | 45 protected: |
| 47 virtual ~TestLauncherDelegate(); | 46 virtual ~TestLauncherDelegate(); |
| 48 }; | 47 }; |
| 49 | 48 |
| 50 // Launches tests using |launcher_delegate|. |default_jobs| is number | 49 // Launches tests using |launcher_delegate|. |default_jobs| is number |
| 51 // of test jobs to be run in parallel, unless overridden from the command line. | 50 // of test jobs to be run in parallel, unless overridden from the command line. |
| 52 // Returns exit code. | 51 // Returns exit code. |
| 53 int LaunchTests(TestLauncherDelegate* launcher_delegate, | 52 int LaunchTests(TestLauncherDelegate* launcher_delegate, |
| 54 int default_jobs, | 53 int default_jobs, |
| 55 int argc, | 54 int argc, |
| 56 char** argv) WARN_UNUSED_RESULT; | 55 char** argv) WARN_UNUSED_RESULT; |
| 57 | 56 |
| 58 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); | 57 TestLauncherDelegate* GetCurrentTestLauncherDelegate(); |
| 59 | 58 |
| 60 } // namespace content | 59 } // namespace content |
| 61 | 60 |
| 62 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ | 61 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ |
| OLD | NEW |