blob: ed76f12cd540d1e28bd269c0e7ffecfe00345b4e [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
Bruno Rochabe388f32011-08-02 12:40:17 -07008#include <string>
9
Bruno Rochabe388f32011-08-02 12:40:17 -070010#include <gmock/gmock.h>
11
Bertrand SIMONNET4b915ae2015-07-28 15:38:14 -070012#include "timer.h"
Bruno Rochabe388f32011-08-02 12:40:17 -070013
14namespace chromeos_metrics {
15
16class TimerMock : public Timer {
17 public:
18 MOCK_METHOD0(Start, bool());
19 MOCK_METHOD0(Stop, bool());
20 MOCK_METHOD0(Reset, bool());
21 MOCK_CONST_METHOD0(HasStarted, bool());
22 MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
23};
24
25class TimerReporterMock : public TimerReporter {
26 public:
Bertrand SIMONNETe6cfd642014-07-09 16:35:23 -070027 TimerReporterMock() : TimerReporter("", 0, 0, 0) {}
Bruno Rochabe388f32011-08-02 12:40:17 -070028 MOCK_METHOD0(Start, bool());
29 MOCK_METHOD0(Stop, bool());
30 MOCK_METHOD0(Reset, bool());
31 MOCK_CONST_METHOD0(HasStarted, bool());
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070032 MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
Bruno Rochabe388f32011-08-02 12:40:17 -070033 MOCK_CONST_METHOD0(ReportMilliseconds, bool());
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070034 MOCK_CONST_METHOD0(histogram_name, std::string&());
35 MOCK_CONST_METHOD0(min, int());
36 MOCK_CONST_METHOD0(max, int());
37 MOCK_CONST_METHOD0(num_buckets, int());
Bruno Rochabe388f32011-08-02 12:40:17 -070038};
39
40class ClockWrapperMock : public ClockWrapper {
41 public:
42 MOCK_CONST_METHOD0(GetCurrentTime, base::TimeTicks());
43};
44
45} // namespace chromeos_metrics
46
47#endif // METRICS_TIMER_MOCK_H_