Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: counter_mock.h

Issue 3171023: Add weekly crash counters, refactor metrics_daemon, respect opt-in in library. (Closed) Base URL: http://src.chromium.org/git/metrics.git
Patch Set: Respond to review Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « counter.cc ('k') | counter_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef METRICS_COUNTER_MOCK_H_ 5 #ifndef METRICS_COUNTER_MOCK_H_
6 #define METRICS_COUNTER_MOCK_H_ 6 #define METRICS_COUNTER_MOCK_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include <gmock/gmock.h> 10 #include <gmock/gmock.h>
11 11
12 #include "counter.h" 12 #include "counter.h"
13 13
14 namespace chromeos_metrics { 14 namespace chromeos_metrics {
15 15
16 class TaggedCounterMock : public TaggedCounterInterface { 16 class TaggedCounterMock : public TaggedCounter {
17 public: 17 public:
18 MOCK_METHOD3(Init, void(const char* filename, 18 MOCK_METHOD3(Init, void(const char* filename,
19 Reporter reporter, void* reporter_handle)); 19 Reporter reporter, void* reporter_handle));
20 MOCK_METHOD2(Update, void(int tag, int count)); 20 MOCK_METHOD2(Update, void(int tag, int count));
21 MOCK_METHOD0(Flush, void()); 21 MOCK_METHOD0(Flush, void());
22 }; 22 };
23 23
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));
31 MOCK_METHOD2(Update, void(int32 tag, int32 count));
32 MOCK_METHOD0(Flush, void());
33 };
34
24 class FrequencyCounterMock : public FrequencyCounter { 35 class FrequencyCounterMock : public FrequencyCounter {
25 public: 36 public:
26 MOCK_METHOD4(Init, void(const char* filename, 37 MOCK_METHOD4(Init, void(const char* filename,
27 TaggedCounterInterface::Reporter reporter, 38 TaggedCounterInterface::Reporter reporter,
28 void* reporter_handle, 39 void* reporter_handle,
29 time_t cycle_duration)); 40 time_t cycle_duration));
30 MOCK_METHOD1(Update, void(int32 count)); 41 MOCK_METHOD1(Update, void(int32 count));
42 MOCK_METHOD0(FlushFinishedCycles, void());
31 }; 43 };
32 44
33 } // namespace chromeos_metrics 45 } // namespace chromeos_metrics
34 46
35 #endif // METRICS_COUNTER_MOCK_H_ 47 #endif // METRICS_COUNTER_MOCK_H_
OLDNEW
« no previous file with comments | « counter.cc ('k') | counter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698