Gary Morain | ac1bdb4 | 2012-02-16 17:42:29 -0800 | [diff] [blame] | 1 | // Copyright (c) 2012 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 | |
Darin Petkov | 3ec5534 | 2012-09-28 14:04:44 +0200 | [diff] [blame] | 5 | #ifndef SHILL_MOCK_POWER_MANAGER_H_ |
| 6 | #define SHILL_MOCK_POWER_MANAGER_H_ |
Gary Morain | ac1bdb4 | 2012-02-16 17:42:29 -0800 | [diff] [blame] | 7 | |
| 8 | #include <base/basictypes.h> |
| 9 | #include <gmock/gmock.h> |
| 10 | |
| 11 | #include "shill/power_manager.h" |
| 12 | |
| 13 | namespace shill { |
| 14 | |
| 15 | class ProxyFactory; |
| 16 | |
| 17 | class MockPowerManager : public PowerManager { |
| 18 | public: |
Darin Petkov | 3ec5534 | 2012-09-28 14:04:44 +0200 | [diff] [blame] | 19 | MockPowerManager(EventDispatcher *dispatcher, ProxyFactory *proxy_factory); |
Gary Morain | ac1bdb4 | 2012-02-16 17:42:29 -0800 | [diff] [blame] | 20 | virtual ~MockPowerManager(); |
Darin Petkov | 3ec5534 | 2012-09-28 14:04:44 +0200 | [diff] [blame] | 21 | |
Gary Morain | ac1bdb4 | 2012-02-16 17:42:29 -0800 | [diff] [blame] | 22 | MOCK_METHOD2(AddStateChangeCallback, |
Eric Shienbrood | 3e20a23 | 2012-02-16 11:35:56 -0500 | [diff] [blame] | 23 | void(const std::string &key, |
| 24 | const PowerStateCallback &callback)); |
Gary Morain | 52fabab | 2012-08-22 09:27:31 -0700 | [diff] [blame] | 25 | MOCK_METHOD2(AddSuspendDelayCallback, |
| 26 | void(const std::string &key, |
| 27 | const SuspendDelayCallback &callback)); |
Gary Morain | ac1bdb4 | 2012-02-16 17:42:29 -0800 | [diff] [blame] | 28 | MOCK_METHOD1(RemoveStateChangeCallback, void(const std::string &key)); |
Gary Morain | 52fabab | 2012-08-22 09:27:31 -0700 | [diff] [blame] | 29 | MOCK_METHOD1(RemoveSuspendDelayCallback, void(const std::string &key)); |
Daniel Erat | f975367 | 2013-01-24 10:17:02 -0800 | [diff] [blame] | 30 | MOCK_METHOD3(RegisterSuspendDelay, |
| 31 | bool(base::TimeDelta timeout, |
| 32 | const std::string &description, |
| 33 | int *delay_id_out)); |
Daniel Erat | 0818cca | 2012-12-14 10:16:21 -0800 | [diff] [blame] | 34 | MOCK_METHOD1(UnregisterSuspendDelay, bool(int delay_id)); |
| 35 | MOCK_METHOD2(ReportSuspendReadiness, bool(int delay_id, int suspend_id)); |
Gary Morain | ac1bdb4 | 2012-02-16 17:42:29 -0800 | [diff] [blame] | 36 | |
| 37 | private: |
| 38 | DISALLOW_COPY_AND_ASSIGN(MockPowerManager); |
| 39 | }; |
| 40 | |
| 41 | } // namespace shill |
| 42 | |
Darin Petkov | 3ec5534 | 2012-09-28 14:04:44 +0200 | [diff] [blame] | 43 | #endif // SHILL_MOCK_POWER_MANAGER_H_ |