platform_system_core/metrics/timer_mock.h
Ben Chan 2e6543ddad Update to build against libchrome-242728.
This CL updates metrics to build against libchrome-242728 and also converts
libmetrics into slotted libraries (libmetrics-180609 and libmetrics-242728).

BUG=chromium:341521
BUG=chromium:342866
CQ-DEPEND=CL:186027
CQ-DEPEND=CL:186026
CQ-DEPEND=CL:186037
CQ-DEPEND=CL:186092
CQ-DEPEND=CL:186028
CQ-DEPEND=CL:186029
CQ-DEPEND=CL:186038
CQ-DEPEND=CL:186093
CQ-DEPEND=CL:186100
CQ-DEPEND=CL:186039
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I09dc3d47cfe24a22864abf217658c63493b35cba
Reviewed-on: https://chromium-review.googlesource.com/185187
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
2014-02-12 19:39:45 +00:00

49 lines
1.3 KiB
C++

// Copyright (c) 2011 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_TIMER_MOCK_H_
#define METRICS_TIMER_MOCK_H_
#include <string>
#include <base/basictypes.h>
#include <gmock/gmock.h>
#include "timer.h"
namespace chromeos_metrics {
class TimerMock : public Timer {
public:
MOCK_METHOD0(Start, bool());
MOCK_METHOD0(Stop, bool());
MOCK_METHOD0(Reset, bool());
MOCK_CONST_METHOD0(HasStarted, bool());
MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
};
class TimerReporterMock : public TimerReporter {
public:
TimerReporterMock() : TimerReporter("",0,0,0) {}
MOCK_METHOD0(Start, bool());
MOCK_METHOD0(Stop, bool());
MOCK_METHOD0(Reset, bool());
MOCK_CONST_METHOD0(HasStarted, bool());
MOCK_CONST_METHOD1(GetElapsedTime, bool(base::TimeDelta* elapsed_time));
MOCK_CONST_METHOD0(ReportMilliseconds, bool());
MOCK_CONST_METHOD0(histogram_name, std::string&());
MOCK_CONST_METHOD0(min, int());
MOCK_CONST_METHOD0(max, int());
MOCK_CONST_METHOD0(num_buckets, int());
};
class ClockWrapperMock : public ClockWrapper {
public:
MOCK_CONST_METHOD0(GetCurrentTime, base::TimeTicks());
};
} // namespace chromeos_metrics
#endif // METRICS_TIMER_MOCK_H_