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.BrowserWindow.FirstPaint", | |
| 18 "Startup.BrowserWindow.FirstPaint.CompositingEnded", | |
| 19 }; | |
|
gab
2017/04/18 13:52:15
List all metrics in startup_metrics_utils.cc:
con
themblsha
2017/04/19 15:06:09
Done.
| |
| 20 | |
| 21 } // namespace | |
| 22 | |
| 23 // RecordBrowserWindowFirstPaint and | |
| 24 // RecordBrowserWindowFirstPaintCompositingEnded have a static variables inside, | |
| 25 // so we can't run several tests inside a single process, and thus this test | |
| 26 // cannot be in unit_tests. | |
|
gab
2017/04/18 13:52:15
Remove this paragraph (it's obvious now why it's a
themblsha
2017/04/19 15:06:09
Done.
| |
| 27 | |
| 28 // Tests that the specified startup-specific histograms are indeed reported. | |
|
gab
2017/04/18 13:52:15
Change to:
// Verify that startup histograms are
themblsha
2017/04/19 15:06:09
Done.
| |
| 29 IN_PROC_BROWSER_TEST_F(StartupMetricsTest, ReportsValues) { | |
| 30 for (auto* const histogram : kStartupMetrics) { | |
| 31 while (!base::StatisticsRecorder::FindHistogram(histogram)) | |
| 32 base::RunLoop().RunUntilIdle(); | |
| 33 } | |
| 34 } | |
| OLD | NEW |