| Index: chrome/browser/metrics/startup_metrics_browsertest.cc
|
| diff --git a/chrome/browser/metrics/startup_metrics_browsertest.cc b/chrome/browser/metrics/startup_metrics_browsertest.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..40c6dbbf486659358bfaffa96c7fe8dac4944283
|
| --- /dev/null
|
| +++ b/chrome/browser/metrics/startup_metrics_browsertest.cc
|
| @@ -0,0 +1,33 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include <set>
|
| +
|
| +#include "base/metrics/histogram_samples.h"
|
| +#include "base/metrics/statistics_recorder.h"
|
| +#include "base/run_loop.h"
|
| +#include "chrome/test/base/in_process_browser_test.h"
|
| +
|
| +using StartupMetricsTest = InProcessBrowserTest;
|
| +
|
| +namespace {
|
| +
|
| +constexpr const char* kStartupMetrics[] = {
|
| + "Startup.BrowserView.FirstPaint",
|
| + "Startup.BrowserView.FirstPaint.CompositingEnded",
|
| +};
|
| +
|
| +} // namespace
|
| +
|
| +// RecordBrowserViewFirstPaint and RecordBrowserViewFirstPaintCompositingEnded
|
| +// have a static variables inside, so we can't run several tests inside a single
|
| +// process, and thus this test cannot be in unit_tests.
|
| +
|
| +// Tests that the specified startup-specific histograms are indeed reported.
|
| +IN_PROC_BROWSER_TEST_F(StartupMetricsTest, ReportsValues) {
|
| + for (auto* const histogram : kStartupMetrics) {
|
| + while (!base::StatisticsRecorder::FindHistogram(histogram))
|
| + base::RunLoop().RunUntilIdle();
|
| + }
|
| +}
|
|
|