Chromium Code Reviews| 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
|