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

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

Issue 2773973002: Add Startup.BrowserView.FirstPaint / .CompositingEnded histograms. (Closed)
Patch Set: Fix gab's and asvitkine's remarks. 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..c60e5c9e85ec23c172dfc60f646f61f7e1429aba
--- /dev/null
+++ b/chrome/browser/metrics/startup_metrics_browsertest.cc
@@ -0,0 +1,53 @@
+// 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",
+
+// These histograms rely on normal browser startup through BrowserMain,
+// which calls BrowserMainRunnerImpl, which calls ChromeBrowserMainParts
+// which reports these metrics.
+// Currently they're not reported at all during browser_tests.
themblsha 2017/04/19 15:06:09 Should I create a new crbug for this? Fixing this
gab 2017/04/19 18:45:43 Ah, right, let's not bother. Leaving them commente
themblsha 2017/04/20 10:42:23 Done. Startup.BrowserMessageLoopStartHardFaultCou
+
+// "Startup.BrowserMessageLoopStartTime",
+// "Startup.BrowserMessageLoopStartTimeFromMainEntry2",
+// "Startup.LoadTime.ExeMainToDllMain2",
+// "Startup.LoadTime.ProcessCreateToDllMain2",
+// "Startup.LoadTime.ProcessCreateToExeMain2",
+// "Startup.SystemUptime",
+
+#if defined(OS_WIN)
+ "Startup.BrowserMessageLoopStartHardFaultCount",
+ "Startup.Temperature",
+#endif // defined(OS_WIN)
+};
+
+} // 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