Paul Stewart | c2350ee | 2011-10-19 12:28:40 -0700 | [diff] [blame] | 1 | // 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 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 | c2350ee | 2011-10-19 12:28:40 -0700 | [diff] [blame] | 25 | MOCK_METHOD2(CreateInputHandler, |
Eric Shienbrood | 3e20a23 | 2012-02-16 11:35:56 -0500 | [diff] [blame] | 26 | IOHandler *(int fd, |
| 27 | const base::Callback<void(InputData *)> &callback)); |
Paul Stewart | c2350ee | 2011-10-19 12:28:40 -0700 | [diff] [blame] | 28 | |
| 29 | MOCK_METHOD3(CreateReadyHandler, |
| 30 | IOHandler *(int fd, |
| 31 | IOHandler::ReadyMode mode, |
Eric Shienbrood | 3e20a23 | 2012-02-16 11:35:56 -0500 | [diff] [blame] | 32 | const base::Callback<void(int)> &callback)); |
Paul Stewart | c2350ee | 2011-10-19 12:28:40 -0700 | [diff] [blame] | 33 | |
| 34 | private: |
| 35 | DISALLOW_COPY_AND_ASSIGN(MockEventDispatcher); |
| 36 | }; |
| 37 | |
| 38 | } // namespace shill |
| 39 | |
| 40 | #endif // SHILL_MOCK_EVENT_DISPATCHER_H_ |