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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 #include "mojo/public/tests/test_support_private.h"
6
7 #include <assert.h>
8 #include <stddef.h>
9 #include <stdio.h>
10
11 static mojo::test::TestSupport* g_test_support = NULL;
12
13 extern "C" {
14
15 void MojoTestSupportLogPerfResult(const char* test_name,
16 double value,
17 const char* units) {
18 if (g_test_support)
19 g_test_support->LogPerfResult(test_name, value, units);
20 else
21 printf("[no test runner]\t%s\t%g\t%s\n", test_name, value, units);
22 }
23
24 } // extern "C"
25
26 namespace mojo {
27 namespace test {
28
29 TestSupport::~TestSupport() {
30 }
31
32 // static
33 void TestSupport::Init(TestSupport* test_support) {
34 assert(!g_test_support);
35 g_test_support = test_support;
36 }
37
38 // static
39 TestSupport* TestSupport::Get() {
40 return g_test_support;
41 }
42
43 // static
44 void TestSupport::Reset() {
45 g_test_support = NULL;
46 }
47
48 } // namespace test
49 } // namespace mojo
OLDNEW
« 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