test_launcher.h revision d0247b1b59f9c528cb6df88b4f2b9afaf80d181e
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 13class CommandLine; 14 15namespace base { 16class FilePath; 17class RunLoop; 18} 19 20namespace content { 21class ContentMainDelegate; 22 23extern const char kEmptyTestName[]; 24extern const char kHelpFlag[]; 25extern const char kLaunchAsBrowser[]; 26extern const char kRunManualTestsFlag[]; 27extern const char kSingleProcessTestsFlag[]; 28 29// Flag that causes only the kEmptyTestName test to be run. 30extern const char kWarmupFlag[]; 31 32class 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; 41 42 protected: 43 virtual ~TestLauncherDelegate(); 44}; 45 46int LaunchTests(TestLauncherDelegate* launcher_delegate, 47 int argc, 48 char** argv) WARN_UNUSED_RESULT; 49 50TestLauncherDelegate* GetCurrentTestLauncherDelegate(); 51 52} // namespace content 53 54#endif // CONTENT_PUBLIC_TEST_TEST_LAUNCHER_H_ 55