Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_TEST_BASE_CHROME_HISTOGRAM_TESTER_H_ | |
| 6 #define CHROME_TEST_BASE_CHROME_HISTOGRAM_TESTER_H_ | |
| 7 | |
| 8 #include "base/test/histogram_tester.h" | |
| 9 | |
| 10 #include "base/memory/linked_ptr.h" | |
| 11 #include "base/metrics/histogram.h" | |
| 12 #include "base/metrics/histogram_base.h" | |
|
Ilya Sherman
2014/07/15 03:56:36
nit: Are these two includes needed?
Mike Lerman
2014/07/16 17:29:04
These four aren't needed!
| |
| 13 #include "base/metrics/histogram_samples.h" | |
| 14 | |
| 15 // ChromeHistogramTester provides a simple interface for examining UMA | |
| 16 // histograms. Tests can use this interface to verify that UMA data is getting | |
| 17 // logged as intended. | |
|
Ilya Sherman
2014/07/15 03:56:36
Please document how this class differs from base::
Mike Lerman
2014/07/16 17:29:04
Done.
| |
| 18 class ChromeHistogramTester : public base::HistogramTester { | |
| 19 public: | |
| 20 // ChromeHistogramTester should be created before the execution of the test | |
| 21 // case. | |
| 22 ChromeHistogramTester(); | |
| 23 | |
| 24 ~ChromeHistogramTester(); | |
| 25 | |
| 26 // Fetch the values to be tested. This must be called after the test code has | |
| 27 // been executed but before performing the necessary assertions. This may be | |
| 28 // called multiple times. | |
| 29 virtual void FetchTestingSnapshot() OVERRIDE; | |
| 30 | |
| 31 private: | |
| 32 void FetchCallback(); | |
|
Ilya Sherman
2014/07/15 03:56:36
nit: Please document this method. Also, perhaps "
Mike Lerman
2014/07/16 17:29:04
Done.
| |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(ChromeHistogramTester); | |
|
Ilya Sherman
2014/07/15 03:56:36
nit: This should be the last line in the class.
Mike Lerman
2014/07/16 17:29:04
Done.
| |
| 35 | |
| 36 // The map from histogram names to their snapshots | |
| 37 std::map<std::string, linked_ptr<base::HistogramSamples> > | |
| 38 histogram_snapshots; | |
|
Ilya Sherman
2014/07/15 03:56:36
Is this actually needed? I don't see it being use
Mike Lerman
2014/07/16 17:29:04
Done.
| |
| 39 }; | |
| 40 | |
| 41 #endif // CHROME_TEST_BASE_CHROME_HISTOGRAM_TESTER_H_ | |
| OLD | NEW |