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

Unified Diff: mojo/public/tests/test_support_private.cc

Issue 160003007: Mojo: Make a public test_support shared library. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased again Created 6 years, 10 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
« no previous file with comments | « mojo/public/tests/test_support_private.h ('k') | mojo/public/tests/test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tests/test_support_private.cc
diff --git a/mojo/public/tests/test_support_private.cc b/mojo/public/tests/test_support_private.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d7d02e8e3bcc804aef794abe0cca4ff5c69285f4
--- /dev/null
+++ b/mojo/public/tests/test_support_private.cc
@@ -0,0 +1,49 @@
+// Copyright 2014 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.
+
+#include "mojo/public/tests/test_support_private.h"
+
+#include <assert.h>
+#include <stddef.h>
+#include <stdio.h>
+
+static mojo::test::TestSupport* g_test_support = NULL;
+
+extern "C" {
+
+void MojoTestSupportLogPerfResult(const char* test_name,
+ double value,
+ const char* units) {
+ if (g_test_support)
+ g_test_support->LogPerfResult(test_name, value, units);
+ else
+ printf("[no test runner]\t%s\t%g\t%s\n", test_name, value, units);
+}
+
+} // extern "C"
+
+namespace mojo {
+namespace test {
+
+TestSupport::~TestSupport() {
+}
+
+// static
+void TestSupport::Init(TestSupport* test_support) {
+ assert(!g_test_support);
+ g_test_support = test_support;
+}
+
+// static
+TestSupport* TestSupport::Get() {
+ return g_test_support;
+}
+
+// static
+void TestSupport::Reset() {
+ g_test_support = NULL;
+}
+
+} // namespace test
+} // namespace mojo
« no previous file with comments | « mojo/public/tests/test_support_private.h ('k') | mojo/public/tests/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698