blob: 6eef76152a7a81e91cb6387e150f2347e164e257 [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>
Bruno Rochabe388f32011-08-02 12:40:17 -070012#include <gmock/gmock.h>
13
Bertrand SIMONNETe6cfd642014-07-09 16:35:23 -070014#include "metrics/timer.h"
Bruno Rochabe388f32011-08-02 12:40:17 -070015
16namespace chromeos_metrics {
17
18class TimerMock : public Timer {
19 public:
20 MOCK_METHOD0(Start, bool());
21 MOCK_METHOD0(Stop, bool());
22 MOCK_METHOD0(Reset, bool());
23 MOCK_CONST_METHOD0(HasStarted, bool());
24 MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
25};
26
27class TimerReporterMock : public TimerReporter {
28 public:
Bertrand SIMONNETe6cfd642014-07-09 16:35:23 -070029 TimerReporterMock() : TimerReporter("", 0, 0, 0) {}
Bruno Rochabe388f32011-08-02 12:40:17 -070030 MOCK_METHOD0(Start, bool());
31 MOCK_METHOD0(Stop, bool());
32 MOCK_METHOD0(Reset, bool());
33 MOCK_CONST_METHOD0(HasStarted, bool());
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070034 MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
Bruno Rochabe388f32011-08-02 12:40:17 -070035 MOCK_CONST_METHOD0(ReportMilliseconds, bool());
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070036 MOCK_CONST_METHOD0(histogram_name, std::string&());
37 MOCK_CONST_METHOD0(min, int());
38 MOCK_CONST_METHOD0(max, int());
39 MOCK_CONST_METHOD0(num_buckets, int());
Bruno Rochabe388f32011-08-02 12:40:17 -070040};
41
42class ClockWrapperMock : public ClockWrapper {
43 public:
44 MOCK_CONST_METHOD0(GetCurrentTime, base::TimeTicks());
45};
46
47} // namespace chromeos_metrics
48
49#endif // METRICS_TIMER_MOCK_H_