Index: chrome/test/out_of_proc_test_runner.h |
diff --git a/chrome/test/out_of_proc_test_runner.h b/chrome/test/out_of_proc_test_runner.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..57cf95fed440d278dd23ea43aff816f49a419b39 |
--- /dev/null |
+++ b/chrome/test/out_of_proc_test_runner.h |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_TEST_OUT_OF_PROC_TEST_RUNNER_H_ |
+#define CHROME_TEST_OUT_OF_PROC_TEST_RUNNER_H_ |
+#pragma once |
+ |
+#include "base/basictypes.h" |
+ |
+namespace test { |
+ |
+// Interface to register tests at runtime. The motivation for this is to provide |
+// a mechanism to register callbacks at linker initialization time to cause test |
+// registration at runtime. |
+class RegisterTestCallback { |
+ public: |
+ RegisterTestCallback(); |
+ virtual void RegisterTest() const = 0; |
+ |
+ protected: |
+ friend void CallRegisterTestCallbacksAndClear(); |
+ virtual ~RegisterTestCallback(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(RegisterTestCallback); |
+}; |
+ |
+// Every |callback| added with this function call will be called early enough in |
+// out_of_proc_test_runner's main to register tests at runtime. |callback| is |
+// owned by out_of_proc_test_runner, which will free it after calling it. |
+void AddRegisterTestCallback(RegisterTestCallback* callback); |
+ |
+} // namespace test |
+ |
+#endif // CHROME_TEST_OUT_OF_PROC_TEST_RUNNER_H_ |