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