Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5233)

Unified Diff: chrome/test/out_of_proc_test_runner.h

Issue 7087014: Support automatic javascript test registry in gtest when creating WebUI tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjusted comments and PathService replacement. Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698