blob: 200ee9aab4dd065a021edeaa09eb275869200bc5 [file] [log] [blame]
Bertrand SIMONNET52e5b992015-08-10 15:18:00 -07001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Bruno Rochabe388f32011-08-02 12:40:17 -070016
17#ifndef METRICS_TIMER_MOCK_H_
18#define METRICS_TIMER_MOCK_H_
19
Bruno Rochabe388f32011-08-02 12:40:17 -070020#include <string>
21
Bruno Rochabe388f32011-08-02 12:40:17 -070022#include <gmock/gmock.h>
23
Samuel Tan1c4d8f12015-09-15 11:40:47 -070024#include "metrics/timer.h"
Bruno Rochabe388f32011-08-02 12:40:17 -070025
26namespace chromeos_metrics {
27
28class TimerMock : public Timer {
29 public:
30 MOCK_METHOD0(Start, bool());
31 MOCK_METHOD0(Stop, bool());
32 MOCK_METHOD0(Reset, bool());
33 MOCK_CONST_METHOD0(HasStarted, bool());
34 MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
35};
36
37class TimerReporterMock : public TimerReporter {
38 public:
Bertrand SIMONNETe6cfd642014-07-09 16:35:23 -070039 TimerReporterMock() : TimerReporter("", 0, 0, 0) {}
Bruno Rochabe388f32011-08-02 12:40:17 -070040 MOCK_METHOD0(Start, bool());
41 MOCK_METHOD0(Stop, bool());
42 MOCK_METHOD0(Reset, bool());
43 MOCK_CONST_METHOD0(HasStarted, bool());
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070044 MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
Bruno Rochabe388f32011-08-02 12:40:17 -070045 MOCK_CONST_METHOD0(ReportMilliseconds, bool());
Bruno Rochae3bdf0f2011-08-18 11:28:30 -070046 MOCK_CONST_METHOD0(histogram_name, std::string&());
47 MOCK_CONST_METHOD0(min, int());
48 MOCK_CONST_METHOD0(max, int());
49 MOCK_CONST_METHOD0(num_buckets, int());
Bruno Rochabe388f32011-08-02 12:40:17 -070050};
51
52class ClockWrapperMock : public ClockWrapper {
53 public:
54 MOCK_CONST_METHOD0(GetCurrentTime, base::TimeTicks());
55};
56
57} // namespace chromeos_metrics
58
59#endif // METRICS_TIMER_MOCK_H_