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.BrowserMainToRendererMain", |
| 18 "Startup.BrowserOpenTabs", |
| 19 "Startup.BrowserWindow.FirstPaint", |
| 20 "Startup.BrowserWindow.FirstPaint.CompositingEnded", |
| 21 "Startup.BrowserWindowDisplay", |
| 22 "Startup.FirstWebContents.MainFrameLoad2", |
| 23 "Startup.FirstWebContents.MainNavigationFinished", |
| 24 "Startup.FirstWebContents.MainNavigationStart", |
| 25 "Startup.FirstWebContents.NonEmptyPaint2", |
| 26 |
| 27 // The following histograms depend on normal browser startup through |
| 28 // BrowserMain and are as such not caught by this browser test. |
| 29 // "Startup.BrowserMessageLoopStartHardFaultCount", |
| 30 // "Startup.BrowserMessageLoopStartTime", |
| 31 // "Startup.BrowserMessageLoopStartTimeFromMainEntry2", |
| 32 // "Startup.LoadTime.ExeMainToDllMain2", |
| 33 // "Startup.LoadTime.ProcessCreateToDllMain2", |
| 34 // "Startup.LoadTime.ProcessCreateToExeMain2", |
| 35 // "Startup.SystemUptime", |
| 36 // "Startup.Temperature", |
| 37 }; |
| 38 |
| 39 } // namespace |
| 40 |
| 41 // Verify that startup histograms are logged on browser startup. |
| 42 IN_PROC_BROWSER_TEST_F(StartupMetricsTest, ReportsValues) { |
| 43 for (auto* const histogram : kStartupMetrics) { |
| 44 while (!base::StatisticsRecorder::FindHistogram(histogram)) |
| 45 base::RunLoop().RunUntilIdle(); |
| 46 } |
| 47 } |
OLD | NEW |