Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [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 | |
Gilad Arnold | cf175a0 | 2014-07-10 16:48:47 -0700 | [diff] [blame] | 5 | #ifndef UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
| 6 | #define UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_ |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 7 | |
| 8 | #include <gmock/gmock.h> |
| 9 | |
| 10 | #include "update_engine/connection_manager.h" |
| 11 | |
| 12 | namespace chromeos_update_engine { |
| 13 | |
| 14 | // This class mocks the generic interface to the connection manager |
| 15 | // (e.g FlimFlam, Shill, etc.) to consolidate all connection-related |
| 16 | // logic in update_engine. |
| 17 | class MockConnectionManager : public ConnectionManager { |
| 18 | public: |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 19 | explicit MockConnectionManager(SystemState* system_state) |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 20 | : ConnectionManager(system_state) {} |
| 21 | |
Alex Deymo | 6ae9120 | 2014-03-10 19:21:25 -0700 | [diff] [blame] | 22 | MOCK_CONST_METHOD3(GetConnectionProperties, |
| 23 | bool(DBusWrapperInterface* dbus_iface, |
| 24 | NetworkConnectionType* out_type, |
| 25 | NetworkTethering* out_tethering)); |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 26 | |
Alex Deymo | 6ae9120 | 2014-03-10 19:21:25 -0700 | [diff] [blame] | 27 | MOCK_CONST_METHOD2(IsUpdateAllowedOver, bool(NetworkConnectionType type, |
| 28 | NetworkTethering tethering)); |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 29 | |
| 30 | MOCK_CONST_METHOD1(StringForConnectionType, |
| 31 | const char*(NetworkConnectionType type)); |
Alex Deymo | 6ae9120 | 2014-03-10 19:21:25 -0700 | [diff] [blame] | 32 | |
| 33 | MOCK_CONST_METHOD1(StringForTethering, |
| 34 | const char*(NetworkTethering tethering)); |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | } // namespace chromeos_update_engine |
| 38 | |
Gilad Arnold | cf175a0 | 2014-07-10 16:48:47 -0700 | [diff] [blame] | 39 | #endif // UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_ |