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

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: Git cl format 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..dd5628fe7b79b31735ffa59479ab02e73bcc2be4
--- /dev/null
+++ b/chrome/test/base/chrome_histogram_tester.cc
@@ -0,0 +1,31 @@
+// 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() {
+ 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();
+}
Ilya Sherman 2014/07/16 20:01:12 It's interesting to note that this method does not
Mike Lerman 2014/07/17 15:04:18 I was hoping to have something I could add under /
Ilya Sherman 2014/07/17 18:35:09 I don't think the comment is needed, for two reaso

Powered by Google App Engine
This is Rietveld 408576698