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

Unified Diff: chrome/test/base/chrome_histogram_tester.cc

Issue 379283002: Rework UMAHistogramHelper and StatisticsDeltaReader into [Chrome]HistogramTester. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ilya's initial comments Created 6 years, 5 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/test/base/chrome_histogram_tester.cc
diff --git a/chrome/test/base/chrome_histogram_tester.cc b/chrome/test/base/chrome_histogram_tester.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5f963004a056636a53b4a4f0da2aac0f3617951d
--- /dev/null
+++ b/chrome/test/base/chrome_histogram_tester.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2012 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 "chrome/test/base/chrome_histogram_tester.h"
+
+#include "base/bind.h"
+#include "base/test/test_timeouts.h"
+#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/histogram_fetcher.h"
+
+ChromeHistogramTester::ChromeHistogramTester() {
+}
+
+ChromeHistogramTester::~ChromeHistogramTester() {
+}
+
+
+void ChromeHistogramTester::FetchTestingSnapshot() {
+
Ilya Sherman 2014/07/16 18:44:47 nit: Spurious newline.
Mike Lerman 2014/07/16 19:36:36 Done.
+ scoped_refptr<content::MessageLoopRunner> runner =
+ new content::MessageLoopRunner;
+
+ content::FetchHistogramsAsynchronously(
+ base::MessageLoop::current(),
+ runner->QuitClosure(),
+ // If this call times out, it means that a child process is not
+ // responding, which is something we should not ignore. The timeout is
+ // set to be longer than the normal browser test timeout so that it will
+ // be prempted by the normal timeout.
+ TestTimeouts::action_max_timeout() * 2);
+ runner->Run();
+}

Powered by Google App Engine
This is Rietveld 408576698