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 | |
Alex Deymo | f6ee016 | 2015-07-31 12:35:22 -0700 | [diff] [blame] | 10 | #include "update_engine/connection_manager_interface.h" |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 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. |
Alex Deymo | f6ee016 | 2015-07-31 12:35:22 -0700 | [diff] [blame] | 17 | class MockConnectionManager : public ConnectionManagerInterface { |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 18 | public: |
Alex Deymo | f6ee016 | 2015-07-31 12:35:22 -0700 | [diff] [blame] | 19 | MockConnectionManager() = default; |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 20 | |
Alex Deymo | 3053450 | 2015-07-20 15:06:33 -0700 | [diff] [blame] | 21 | MOCK_METHOD2(GetConnectionProperties, |
| 22 | bool(NetworkConnectionType* out_type, |
| 23 | NetworkTethering* out_tethering)); |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 24 | |
Alex Deymo | 6ae9120 | 2014-03-10 19:21:25 -0700 | [diff] [blame] | 25 | MOCK_CONST_METHOD2(IsUpdateAllowedOver, bool(NetworkConnectionType type, |
| 26 | NetworkTethering tethering)); |
Jay Srinivasan | 4348879 | 2012-06-19 00:25:31 -0700 | [diff] [blame] | 27 | }; |
| 28 | |
| 29 | } // namespace chromeos_update_engine |
| 30 | |
Gilad Arnold | cf175a0 | 2014-07-10 16:48:47 -0700 | [diff] [blame] | 31 | #endif // UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_ |