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

Side by Side Diff: chrome/browser/metrics/startup_metrics_browsertest.cc

Issue 2773973002: Add Startup.BrowserView.FirstPaint / .CompositingEnded histograms. (Closed)
Patch Set: Use more correct place to report timings in Cocoa, fix review remarks. Created 3 years, 8 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 2017 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 <set>
6
7 #include "base/metrics/histogram_samples.h"
8 #include "base/metrics/statistics_recorder.h"
9 #include "base/run_loop.h"
10 #include "chrome/test/base/in_process_browser_test.h"
11
12 using StartupMetricsTest = InProcessBrowserTest;
13
14 namespace {
15
16 constexpr const char* kStartupMetrics[] = {
17 "Startup.BrowserView.FirstPaint",
18 "Startup.BrowserView.FirstPaint.CompositingEnded",
19 };
20
21 } // namespace
22
23 // RecordBrowserViewFirstPaint and RecordBrowserViewFirstPaintCompositingEnded
24 // have a static variables inside, so we can't run several tests inside a single
25 // process, and thus this test cannot be in unit_tests.
26
27 // Tests that the specified startup-specific histograms are indeed reported.
28 IN_PROC_BROWSER_TEST_F(StartupMetricsTest, ReportsValues) {
29 for (auto* const histogram : kStartupMetrics) {
30 while (!base::StatisticsRecorder::FindHistogram(histogram)) {
sky 2017/04/11 17:13:36 no {}
themblsha 2017/04/12 17:18:28 Done.
31 base::RunLoop().RunUntilIdle();
32 }
33 }
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698