blob: 3f521f463f238fa9a2f29a7fea00d4fc9d83ceb3 [file] [log] [blame]
Paul Stewart5f06a0e2012-12-20 11:11:33 -08001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Paul Stewartc2350ee2011-10-19 12:28:40 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_MOCK_EVENT_DISPATCHER_H_
6#define SHILL_MOCK_EVENT_DISPATCHER_H_
7
8#include <base/basictypes.h>
9#include <gmock/gmock.h>
10
11#include "shill/event_dispatcher.h"
12
13namespace shill {
14
15class MockEventDispatcher : public EventDispatcher {
16 public:
17 MockEventDispatcher();
18 virtual ~MockEventDispatcher();
19
20 MOCK_METHOD0(DispatchForever, void());
21 MOCK_METHOD0(DispatchPendingEvents, void());
Eric Shienbrood3e20a232012-02-16 11:35:56 -050022 MOCK_METHOD1(PostTask, bool(const base::Closure &task));
23 MOCK_METHOD2(PostDelayedTask, bool(const base::Closure &task,
24 int64 delay_ms));
Paul Stewart5f06a0e2012-12-20 11:11:33 -080025 MOCK_METHOD3(CreateInputHandler, IOHandler *(
26 int fd,
27 const IOHandler::InputCallback &input_callback,
28 const IOHandler::ErrorCallback &error_callback));
Paul Stewartc2350ee2011-10-19 12:28:40 -070029
30 MOCK_METHOD3(CreateReadyHandler,
31 IOHandler *(int fd,
32 IOHandler::ReadyMode mode,
Eric Shienbrood3e20a232012-02-16 11:35:56 -050033 const base::Callback<void(int)> &callback));
Paul Stewartc2350ee2011-10-19 12:28:40 -070034
35 private:
36 DISALLOW_COPY_AND_ASSIGN(MockEventDispatcher);
37};
38
39} // namespace shill
40
41#endif // SHILL_MOCK_EVENT_DISPATCHER_H_