Chromium Code Reviews| OLD | NEW |
|---|---|
| (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"; | |
|
gab
2017/04/06 15:30:01
Add all other metrics recorded from components/sta
themblsha
2017/04/10 17:28:19
It wasn't compiling with '[][]' it worked only wit
| |
| 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. | |
|
gab
2017/04/06 15:30:01
Singular "test" now that we have just one.
themblsha
2017/04/10 17:28:19
Done.
| |
| 24 | |
| 25 IN_PROC_BROWSER_TEST_F(BrowserViewHistogramHelperTest, ReportsValues) { | |
| 26 base::HistogramBase* histogram = nullptr; | |
| 27 while (!histogram) { | |
| 28 histogram = base::StatisticsRecorder::FindHistogram( | |
| 29 kStartupBrowserViewFirstPaintHistogramName); | |
| 30 base::RunLoop().RunUntilIdle(); | |
| 31 } | |
| 32 | |
| 33 histogram = nullptr; | |
| 34 while (!histogram) { | |
| 35 histogram = base::StatisticsRecorder::FindHistogram( | |
| 36 kStartupBrowserViewFirstPaintCompositingEndedHistogramName); | |
| 37 base::RunLoop().RunUntilIdle(); | |
| 38 } | |
| 39 | |
| 40 EXPECT_EQ(1, histogram->SnapshotSamples()->TotalCount()); | |
| 41 } | |
| OLD | NEW |