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 <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 } | |
| OLD | NEW |