Paul Stewart | 5f06a0e | 2012-12-20 11:11:33 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Paul Stewart | c2350ee | 2011-10-19 12:28:40 -0700 | [diff] [blame] | 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 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 | |
| 13 | namespace shill { |
| 14 | |
| 15 | class MockEventDispatcher : public EventDispatcher { |
| 16 | public: |
| 17 | MockEventDispatcher(); |
| 18 | virtual ~MockEventDispatcher(); |
| 19 | |
| 20 | MOCK_METHOD0(DispatchForever, void()); |
| 21 | MOCK_METHOD0(DispatchPendingEvents, void()); |
Eric Shienbrood | 3e20a23 | 2012-02-16 11:35:56 -0500 | [diff] [blame] | 22 | MOCK_METHOD1(PostTask, bool(const base::Closure &task)); |
| 23 | MOCK_METHOD2(PostDelayedTask, bool(const base::Closure &task, |
| 24 | int64 delay_ms)); |
Paul Stewart | 5f06a0e | 2012-12-20 11:11:33 -0800 | [diff] [blame] | 25 | MOCK_METHOD3(CreateInputHandler, IOHandler *( |
| 26 | int fd, |
| 27 | const IOHandler::InputCallback &input_callback, |
| 28 | const IOHandler::ErrorCallback &error_callback)); |
Paul Stewart | c2350ee | 2011-10-19 12:28:40 -0700 | [diff] [blame] | 29 | |
| 30 | MOCK_METHOD3(CreateReadyHandler, |
| 31 | IOHandler *(int fd, |
| 32 | IOHandler::ReadyMode mode, |
Eric Shienbrood | 3e20a23 | 2012-02-16 11:35:56 -0500 | [diff] [blame] | 33 | const base::Callback<void(int)> &callback)); |
Paul Stewart | c2350ee | 2011-10-19 12:28:40 -0700 | [diff] [blame] | 34 | |
| 35 | private: |
| 36 | DISALLOW_COPY_AND_ASSIGN(MockEventDispatcher); |
| 37 | }; |
| 38 | |
| 39 | } // namespace shill |
| 40 | |
| 41 | #endif // SHILL_MOCK_EVENT_DISPATCHER_H_ |