2010-06-11 00:59:53 +02:00
|
|
|
// Copyright (c) 2010 The Chromium OS 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 METRICS_COUNTER_MOCK_H_
|
|
|
|
#define METRICS_COUNTER_MOCK_H_
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <gmock/gmock.h>
|
|
|
|
|
|
|
|
#include "counter.h"
|
|
|
|
|
|
|
|
namespace chromeos_metrics {
|
|
|
|
|
2010-08-27 03:35:06 +02:00
|
|
|
class TaggedCounterMock : public TaggedCounter {
|
2010-06-11 00:59:53 +02:00
|
|
|
public:
|
|
|
|
MOCK_METHOD3(Init, void(const char* filename,
|
|
|
|
Reporter reporter, void* reporter_handle));
|
|
|
|
MOCK_METHOD2(Update, void(int tag, int count));
|
|
|
|
MOCK_METHOD0(Flush, void());
|
|
|
|
};
|
|
|
|
|
2010-08-27 03:35:06 +02:00
|
|
|
class TaggedCounterReporterMock : public TaggedCounterReporter {
|
|
|
|
public:
|
|
|
|
MOCK_METHOD5(Init, void(const char* filename,
|
|
|
|
const char* histogram_name,
|
|
|
|
int min,
|
|
|
|
int max,
|
|
|
|
int nbuckets));
|
|
|
|
MOCK_METHOD2(Update, void(int32 tag, int32 count));
|
|
|
|
MOCK_METHOD0(Flush, void());
|
|
|
|
};
|
|
|
|
|
2010-08-17 04:57:13 +02:00
|
|
|
class FrequencyCounterMock : public FrequencyCounter {
|
|
|
|
public:
|
|
|
|
MOCK_METHOD4(Init, void(const char* filename,
|
|
|
|
TaggedCounterInterface::Reporter reporter,
|
|
|
|
void* reporter_handle,
|
|
|
|
time_t cycle_duration));
|
|
|
|
MOCK_METHOD1(Update, void(int32 count));
|
2010-08-27 03:35:06 +02:00
|
|
|
MOCK_METHOD0(FlushFinishedCycles, void());
|
2010-08-17 04:57:13 +02:00
|
|
|
};
|
|
|
|
|
2010-06-11 00:59:53 +02:00
|
|
|
} // namespace chromeos_metrics
|
|
|
|
|
|
|
|
#endif // METRICS_COUNTER_MOCK_H_
|