Index: chrome/test/base/chrome_histogram_tester.h |
diff --git a/chrome/test/base/chrome_histogram_tester.h b/chrome/test/base/chrome_histogram_tester.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..40cdb461db2fcc16291c7412257f53ac1deeb396 |
--- /dev/null |
+++ b/chrome/test/base/chrome_histogram_tester.h |
@@ -0,0 +1,30 @@ |
+// 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. |
+ |
+#ifndef CHROME_TEST_BASE_CHROME_HISTOGRAM_TESTER_H_ |
+#define CHROME_TEST_BASE_CHROME_HISTOGRAM_TESTER_H_ |
+ |
+#include "base/test/histogram_tester.h" |
+ |
+// ChromeHistogramTester extends the base class by allowing the MessageLoop |
+// to be fully run by calling |FetchTestingSnapshot| before executing the |
+// histogram tests. |
Ilya Sherman
2014/07/16 18:44:47
More precisely, the Chrome subclass calls out to o
Mike Lerman
2014/07/16 19:36:36
I had thought half the benefit, since this is used
Ilya Sherman
2014/07/16 20:01:12
Yes, this is the entire benefit. However, the oth
|
+class ChromeHistogramTester : public base::HistogramTester { |
+ public: |
+ // ChromeHistogramTester should be created before the execution of the test |
+ // case. |
+ ChromeHistogramTester(); |
+ |
+ ~ChromeHistogramTester(); |
+ |
+ // Fetch the values to be tested. This must be called after the test code has |
+ // been executed but before performing the necessary assertions. This may be |
+ // called multiple times. |
+ void FetchTestingSnapshot(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(ChromeHistogramTester); |
+}; |
+ |
+#endif // CHROME_TEST_BASE_CHROME_HISTOGRAM_TESTER_H_ |