OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 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 <memory> |
| 6 |
| 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/test/launcher/unit_test_launcher.h" |
| 9 #include "base/test/perf_log.h" |
| 10 #include "components/test/components_test_suit.h" |
| 11 |
| 12 class ComponentsPerfTestSuite : public ComponentsTestSuite { |
| 13 public: |
| 14 ComponentsPerfTestSuite(int argc, char** argv) |
| 15 : ComponentsTestSuite(argc, argv) {} |
| 16 |
| 17 void Initialize() final { |
| 18 ComponentsTestSuite::Initialize(); |
| 19 CHECK(base::InitPerfLog()); |
| 20 } |
| 21 |
| 22 void Shutdown() final { |
| 23 base::FinalizePerfLog(); |
| 24 ComponentsTestSuite::Shutdown(); |
| 25 } |
| 26 }; |
| 27 |
| 28 int main(int argc, char** argv) { |
| 29 auto test_suite = base::MakeUnique<ComponentsPerfTestSuite>(argc, argv); |
| 30 // Raise to high priority to have more precise measurements. Since we don't |
| 31 // aim at 1% precision, it is not necessary to run at realtime level. |
| 32 if (!base::debug::BeingDebugged()) |
| 33 base::RaiseProcessToHighPriority(); |
| 34 return base::LaunchUnitTestsSerially( |
| 35 argc, argv, CreateCallbackForLaunch(std::move(test_suite))); |
| 36 } |
OLD | NEW |