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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view_histogram_helper_browsertest.cc

Issue 2773973002: Add Startup.BrowserView.FirstPaint / .CompositingEnded histograms. (Closed)
Patch Set: Created 3 years, 9 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 "base/metrics/histogram_samples.h"
6 #include "base/metrics/statistics_recorder.h"
7 #include "base/run_loop.h"
8 #include "chrome/test/base/in_process_browser_test.h"
9
10 namespace {
11
12 const char kStartupBrowserViewFirstPaintHistogramName[] =
13 "Startup.BrowserView.FirstPaint";
14 const char kStartupBrowserViewFirstPaintCompositingEndedHistogramName[] =
15 "Startup.BrowserView.FirstPaint.CompositingEnded";
16
17 } // namespace
18
19 using BrowserViewHistogramHelperTest = InProcessBrowserTest;
20
21 // RecordBrowserViewFirstPaint and RecordBrowserViewFirstPaintCompositingEnded
22 // have a static variables inside, so we can't run several tests inside a single
23 // process, and thus these tests cannot be unit_tests.
24
25 IN_PROC_BROWSER_TEST_F(BrowserViewHistogramHelperTest, FirstPaint) {
26 base::HistogramBase* histogram = nullptr;
27 while (!histogram) {
28 histogram = base::StatisticsRecorder::FindHistogram(
29 kStartupBrowserViewFirstPaintHistogramName);
30 base::RunLoop().RunUntilIdle();
31 }
32 EXPECT_EQ(1, histogram->SnapshotSamples()->TotalCount());
33 }
34
35 IN_PROC_BROWSER_TEST_F(BrowserViewHistogramHelperTest,
36 FirstPaintCompositingEnded) {
37 base::HistogramBase* histogram = nullptr;
38 while (!histogram) {
39 histogram = base::StatisticsRecorder::FindHistogram(
40 kStartupBrowserViewFirstPaintCompositingEndedHistogramName);
41 base::RunLoop().RunUntilIdle();
42 }
43 EXPECT_EQ(1, histogram->SnapshotSamples()->TotalCount());
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698