blob: 1f0c9de60fc8364533996c10a0c42217a5377d78 [file] [log] [blame]
Bruno Rochabe388f32011-08-02 12:40:17 -07001// Copyright (c) 2011 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_TIMER_MOCK_H_
6#define METRICS_TIMER_MOCK_H_
7
8
9#include <string>
10
11#include <base/basictypes.h>
12#include <base/time.h>
13#include <gmock/gmock.h>
14
15#include "timer.h"
16
17namespace chromeos_metrics {
18
19class TimerMock : public Timer {
20 public:
21 MOCK_METHOD0(Start, bool());
22 MOCK_METHOD0(Stop, bool());
23 MOCK_METHOD0(Reset, bool());
24 MOCK_CONST_METHOD0(HasStarted, bool());
25 MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
26};
27
28class TimerReporterMock : public TimerReporter {
29 public:
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070030 TimerReporterMock() : TimerReporter("",0,0,0) {}
Bruno Rochabe388f32011-08-02 12:40:17 -070031 MOCK_METHOD0(Start, bool());
32 MOCK_METHOD0(Stop, bool());
33 MOCK_METHOD0(Reset, bool());
34 MOCK_CONST_METHOD0(HasStarted, bool());
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070035 MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
Bruno Rochabe388f32011-08-02 12:40:17 -070036 MOCK_CONST_METHOD0(ReportMilliseconds, bool());
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070037 MOCK_CONST_METHOD0(histogram_name, std::string&());
38 MOCK_CONST_METHOD0(min, int());
39 MOCK_CONST_METHOD0(max, int());
40 MOCK_CONST_METHOD0(num_buckets, int());
Bruno Rochabe388f32011-08-02 12:40:17 -070041};
42
43class ClockWrapperMock : public ClockWrapper {
44 public:
45 MOCK_CONST_METHOD0(GetCurrentTime, base::TimeTicks());
46};
47
48} // namespace chromeos_metrics
49
50#endif // METRICS_TIMER_MOCK_H_