Darin Petkov | f1e85e4 | 2010-06-10 15:59:53 -0700 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium OS 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 METRICS_COUNTER_MOCK_H_ |
| 6 | #define METRICS_COUNTER_MOCK_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <gmock/gmock.h> |
| 11 | |
| 12 | #include "counter.h" |
| 13 | |
| 14 | namespace chromeos_metrics { |
| 15 | |
Ken Mixter | 4c5daa4 | 2010-08-26 18:35:06 -0700 | [diff] [blame] | 16 | class TaggedCounterMock : public TaggedCounter { |
Darin Petkov | f1e85e4 | 2010-06-10 15:59:53 -0700 | [diff] [blame] | 17 | public: |
| 18 | MOCK_METHOD3(Init, void(const char* filename, |
| 19 | Reporter reporter, void* reporter_handle)); |
Luigi Semenzato | 859b3f0 | 2014-02-05 15:33:19 -0800 | [diff] [blame] | 20 | MOCK_METHOD3(Update, void(uint32 report_tag, uint32 reset_tag, int32 count)); |
Darin Petkov | f1e85e4 | 2010-06-10 15:59:53 -0700 | [diff] [blame] | 21 | MOCK_METHOD0(Flush, void()); |
| 22 | }; |
| 23 | |
Ken Mixter | 4c5daa4 | 2010-08-26 18:35:06 -0700 | [diff] [blame] | 24 | class TaggedCounterReporterMock : public TaggedCounterReporter { |
| 25 | public: |
| 26 | MOCK_METHOD5(Init, void(const char* filename, |
| 27 | const char* histogram_name, |
| 28 | int min, |
| 29 | int max, |
| 30 | int nbuckets)); |
Luigi Semenzato | 859b3f0 | 2014-02-05 15:33:19 -0800 | [diff] [blame] | 31 | MOCK_METHOD3(Update, void(uint32 report_tag, uint32 reset_tag, int32 count)); |
Ken Mixter | 4c5daa4 | 2010-08-26 18:35:06 -0700 | [diff] [blame] | 32 | MOCK_METHOD0(Flush, void()); |
| 33 | }; |
| 34 | |
Ken Mixter | ccd84c0 | 2010-08-16 19:57:13 -0700 | [diff] [blame] | 35 | class FrequencyCounterMock : public FrequencyCounter { |
| 36 | public: |
Yunlian Jiang | e6fcdab | 2013-05-13 10:31:45 -0700 | [diff] [blame] | 37 | MOCK_METHOD2(Init, void(TaggedCounterInterface* tagged_counter, |
Ken Mixter | ccd84c0 | 2010-08-16 19:57:13 -0700 | [diff] [blame] | 38 | time_t cycle_duration)); |
| 39 | MOCK_METHOD1(Update, void(int32 count)); |
Ken Mixter | 4c5daa4 | 2010-08-26 18:35:06 -0700 | [diff] [blame] | 40 | MOCK_METHOD0(FlushFinishedCycles, void()); |
Ken Mixter | ccd84c0 | 2010-08-16 19:57:13 -0700 | [diff] [blame] | 41 | }; |
| 42 | |
Darin Petkov | f1e85e4 | 2010-06-10 15:59:53 -0700 | [diff] [blame] | 43 | } // namespace chromeos_metrics |
| 44 | |
| 45 | #endif // METRICS_COUNTER_MOCK_H_ |