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

Side by Side Diff: components/omnibox/browser/history_quick_provider_performance_unittest.cc

Issue 2358063002: Preparing components_perftests (Closed)
Patch Set: Attempt to guess how generate_perf_json.py works Created 4 years, 2 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
OLDNEW
(Empty)
1 // Copyright 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 "base/time/time.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "testing/perf/perf_test.h"
8
9 namespace {
10 base::TimeDelta EmptyActivity() {
11 base::Time regular_start = base::Time::Now();
12 base::ThreadTicks thread_start;
13 if (base::ThreadTicks::IsSupported())
14 thread_start = base::ThreadTicks::Now();
15
16 LOG(INFO) << "Activly do nothing";
17
18 if (base::ThreadTicks::IsSupported())
19 return base::ThreadTicks::Now() - thread_start;
20
21 return base::Time::Now() - regular_start;
22 }
23
24 } // namespace
25
26 TEST(BlankPerfTest, BlankActivity) {
27 auto test_info = ::testing::UnitTest::GetInstance()->current_test_info();
28
29 const std::size_t kRepeatCount = 10;
30
31 std::string durations;
32 for (std::size_t i = 0; i < kRepeatCount; ++i)
33 durations += std::to_string(EmptyActivity().InMicroseconds()) + ',';
34
35 perf_test::PrintResultList(test_info->test_case_name(), test_info->name(),
36 "trace", durations, "ms", true);
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698