Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3786)

Unified Diff: chrome/browser/metrics/startup_metrics_browsertest.cc

Issue 2773973002: Add Startup.BrowserView.FirstPaint / .CompositingEnded histograms. (Closed)
Patch Set: Don't wait for histograms that are not reported during browser_tests. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..71932aff5228498d725ce49fc46736a3fe1b4d88
--- /dev/null
+++ b/chrome/browser/metrics/startup_metrics_browsertest.cc
@@ -0,0 +1,47 @@
+// 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.BrowserMainToRendererMain",
+ "Startup.BrowserOpenTabs",
+ "Startup.BrowserWindow.FirstPaint",
+ "Startup.BrowserWindow.FirstPaint.CompositingEnded",
+ "Startup.BrowserWindowDisplay",
+ "Startup.FirstWebContents.MainFrameLoad2",
+ "Startup.FirstWebContents.MainNavigationFinished",
+ "Startup.FirstWebContents.MainNavigationStart",
+ "Startup.FirstWebContents.NonEmptyPaint2",
+
+ // The following histograms depend on normal browser startup through
+ // BrowserMain and are as such not caught by this browser test.
+ // "Startup.BrowserMessageLoopStartHardFaultCount",
+ // "Startup.BrowserMessageLoopStartTime",
+ // "Startup.BrowserMessageLoopStartTimeFromMainEntry2",
+ // "Startup.LoadTime.ExeMainToDllMain2",
+ // "Startup.LoadTime.ProcessCreateToDllMain2",
+ // "Startup.LoadTime.ProcessCreateToExeMain2",
+ // "Startup.SystemUptime",
+ // "Startup.Temperature",
+};
+
+} // namespace
+
+// Verify that startup histograms are logged on browser startup.
+IN_PROC_BROWSER_TEST_F(StartupMetricsTest, ReportsValues) {
+ for (auto* const histogram : kStartupMetrics) {
+ while (!base::StatisticsRecorder::FindHistogram(histogram))
+ base::RunLoop().RunUntilIdle();
+ }
+}
« no previous file with comments | « chrome/browser/metrics/first_web_contents_profiler.cc ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698