mock_connection_manager.h revision d2779df63aaad8b65fc5d4badee7dbc9bed7f2b6
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 5#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_ 6#define CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_ 7 8#include <gmock/gmock.h> 9 10#include "update_engine/connection_manager.h" 11 12namespace 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. 17class MockConnectionManager : public ConnectionManager { 18 public: 19 explicit MockConnectionManager(SystemState* system_state) 20 : ConnectionManager(system_state) {} 21 22 MOCK_CONST_METHOD3(GetConnectionProperties, 23 bool(DBusWrapperInterface* dbus_iface, 24 NetworkConnectionType* out_type, 25 NetworkTethering* out_tethering)); 26 27 MOCK_CONST_METHOD2(IsUpdateAllowedOver, bool(NetworkConnectionType type, 28 NetworkTethering tethering)); 29 30 MOCK_CONST_METHOD1(StringForConnectionType, 31 const char*(NetworkConnectionType type)); 32 33 MOCK_CONST_METHOD1(StringForTethering, 34 const char*(NetworkTethering tethering)); 35}; 36 37} // namespace chromeos_update_engine 38 39#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_ 40