OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_ | 5 #ifndef MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_ |
6 #define MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_ | 6 #define MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 namespace test { | 14 namespace test { |
15 | 15 |
16 class TestBase : public testing::Test { | 16 class TestBase : public testing::Test { |
17 public: | 17 public: |
18 TestBase(); | 18 TestBase(); |
19 virtual ~TestBase(); | 19 virtual ~TestBase(); |
20 | 20 |
21 virtual void SetUp() OVERRIDE; | |
22 | |
23 private: | 21 private: |
24 DISALLOW_COPY_AND_ASSIGN(TestBase); | 22 DISALLOW_COPY_AND_ASSIGN(TestBase); |
25 }; | 23 }; |
26 | 24 |
27 // Run |single_iteration| an appropriate number of times and report its | 25 // Run |single_iteration| an appropriate number of times and report its |
28 // performance appropriately. (This actually runs |single_iteration| for a fixed | 26 // performance appropriately. (This actually runs |single_iteration| for a fixed |
29 // amount of time and reports the number of iterations per unit time.) | 27 // amount of time and reports the number of iterations per unit time.) |
30 void IterateAndReportPerf(const char* test_name, | 28 void IterateAndReportPerf(const char* test_name, |
31 base::Callback<void()> single_iteration); | 29 base::Callback<void()> single_iteration); |
32 | 30 |
33 } // namespace test | 31 } // namespace test |
34 } // namespace mojo | 32 } // namespace mojo |
35 | 33 |
36 #endif // MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_ | 34 #endif // MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_ |
OLD | NEW |