IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / public / test / test_launcher.h
blob268eab5fa9e7b62734064be934eb2a943f975fb0
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_
6 #define CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_
8 #include <string>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
13 class CommandLine;
15 namespace base {
16 class FilePath;
17 class RunLoop;
20 namespace content {
21 class ContentMainDelegate;
23 extern const char kEmptyTestName[];
24 extern const char kHelpFlag[];
25 extern const char kLaunchAsBrowser[];
26 extern const char kRunManualTestsFlag[];
27 extern const char kSingleProcessTestsFlag[];
29 // Flag that causes only the kEmptyTestName test to be run.
30 extern const char kWarmupFlag[];
32 class TestLauncherDelegate {
33 public:
34 virtual int RunTestSuite(int argc, char** argv) = 0;
35 virtual bool AdjustChildProcessCommandLine(
36 CommandLine* command_line,
37 const base::FilePath& temp_data_dir) = 0;
38 virtual void PreRunMessageLoop(base::RunLoop* run_loop) {}
39 virtual void PostRunMessageLoop() {}
40 virtual ContentMainDelegate* CreateContentMainDelegate() = 0;
42 protected:
43 virtual ~TestLauncherDelegate();
46 // Launches tests using |launcher_delegate|. |default_jobs| is number
47 // of test jobs to be run in parallel, unless overridden from the command line.
48 // Returns exit code.
49 int LaunchTests(TestLauncherDelegate* launcher_delegate,
50 int default_jobs,
51 int argc,
52 char** argv) WARN_UNUSED_RESULT;
54 TestLauncherDelegate* GetCurrentTestLauncherDelegate();
56 } // namespace content
58 #endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_