| 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" | |
| 9 #include "base/callback.h" | 8 #include "base/callback.h" |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "testing/gtest/include/gtest/gtest.h" | |
| 12 | 9 |
| 13 namespace mojo { | 10 namespace mojo { |
| 14 namespace test { | 11 namespace test { |
| 15 | 12 |
| 16 class TestBase : public testing::Test { | |
| 17 public: | |
| 18 TestBase(); | |
| 19 virtual ~TestBase(); | |
| 20 | |
| 21 private: | |
| 22 DISALLOW_COPY_AND_ASSIGN(TestBase); | |
| 23 }; | |
| 24 | |
| 25 // Run |single_iteration| an appropriate number of times and report its | 13 // Run |single_iteration| an appropriate number of times and report its |
| 26 // performance appropriately. (This actually runs |single_iteration| for a fixed | 14 // performance appropriately. (This actually runs |single_iteration| for a fixed |
| 27 // amount of time and reports the number of iterations per unit time.) | 15 // amount of time and reports the number of iterations per unit time.) |
| 28 void IterateAndReportPerf(const char* test_name, | 16 void IterateAndReportPerf(const char* test_name, |
| 29 base::Callback<void()> single_iteration); | 17 base::Callback<void()> single_iteration); |
| 30 | 18 |
| 31 } // namespace test | 19 } // namespace test |
| 32 } // namespace mojo | 20 } // namespace mojo |
| 33 | 21 |
| 34 #endif // MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_ | 22 #endif // MOJO_PUBLIC_TESTS_TEST_SUPPORT_H_ |
| OLD | NEW |