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(); |
+} |