| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2009 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 CHROME_TEST_BROWSER_BROWSER_TEST_RUNNER_ | |
| 6 #define CHROME_TEST_BROWSER_BROWSER_TEST_RUNNER_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 | |
| 13 namespace browser_tests { | |
| 14 | |
| 15 class BrowserTestRunnerFactory; | |
| 16 | |
| 17 // Runs the tests specified by the --gtest_filter flag specified in the command | |
| 18 // line that started this process. | |
| 19 // Returns true if all tests succeeded, false if there were no tests to run, or | |
| 20 // one or more tests failed, or if initialization failed. | |
| 21 // Results are printed to stdout. | |
| 22 bool RunTests(const BrowserTestRunnerFactory& browser_test_runner_factory); | |
| 23 | |
| 24 // This class defines a way to run browser tests. | |
| 25 // There are 2 implementations, in-process and out-of-process. | |
| 26 class BrowserTestRunner { | |
| 27 public: | |
| 28 BrowserTestRunner(); | |
| 29 virtual ~BrowserTestRunner(); | |
| 30 | |
| 31 // Called once before the BrowserTestRunner is used. Gives it an opportunity | |
| 32 // to perform any requried initialization. Should return true if the | |
| 33 // initialization was successful. | |
| 34 virtual bool Init() = 0; | |
| 35 | |
| 36 // Runs the test named |test_name| and returns true if the test succeeded, | |
| 37 // false if it failed. | |
| 38 virtual bool RunTest(const std::string& test_name) = 0; | |
| 39 | |
| 40 private: | |
| 41 DISALLOW_COPY_AND_ASSIGN(BrowserTestRunner); | |
| 42 }; | |
| 43 | |
| 44 class BrowserTestRunnerFactory { | |
| 45 public: | |
| 46 virtual BrowserTestRunner* CreateBrowserTestRunner() const = 0; | |
| 47 }; | |
| 48 | |
| 49 } // namespace | |
| 50 | |
| 51 #endif // CHROME_TEST_BROWSER_BROWSER_TEST_RUNNER_ | |
| OLD | NEW |