OLD | NEW |
(Empty) | |
| 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 CHROME_TEST_OUT_OF_PROC_TEST_RUNNER_H_ |
| 6 #define CHROME_TEST_OUT_OF_PROC_TEST_RUNNER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 |
| 11 namespace test { |
| 12 |
| 13 // Interface to register tests at runtime. The motivation for this is to provide |
| 14 // a mechanism to register callbacks at linker initialization time to cause test |
| 15 // registration at runtime. |
| 16 class RegisterTestCallback { |
| 17 public: |
| 18 RegisterTestCallback(); |
| 19 virtual void RegisterTest() const = 0; |
| 20 |
| 21 protected: |
| 22 friend void CallRegisterTestCallbacksAndClear(); |
| 23 virtual ~RegisterTestCallback(); |
| 24 |
| 25 private: |
| 26 DISALLOW_COPY_AND_ASSIGN(RegisterTestCallback); |
| 27 }; |
| 28 |
| 29 // Every |callback| added with this function call will be called early enough in |
| 30 // out_of_proc_test_runner's main to register tests at runtime. |callback| is |
| 31 // owned by out_of_proc_test_runner, which will free it after calling it. |
| 32 void AddRegisterTestCallback(RegisterTestCallback* callback); |
| 33 |
| 34 } // namespace test |
| 35 |
| 36 #endif // CHROME_TEST_OUT_OF_PROC_TEST_RUNNER_H_ |
OLD | NEW |