blob: 71b3019d4a3cb6743f2fd091da26337f050300f7 [file] [log] [blame]
Jay Srinivasan43488792012-06-19 00:25:31 -07001// 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 MockConnectionManager(SystemState* system_state)
20 : ConnectionManager(system_state) {}
21
Alex Deymo6ae91202014-03-10 19:21:25 -070022 MOCK_CONST_METHOD3(GetConnectionProperties,
23 bool(DBusWrapperInterface* dbus_iface,
24 NetworkConnectionType* out_type,
25 NetworkTethering* out_tethering));
Jay Srinivasan43488792012-06-19 00:25:31 -070026
Alex Deymo6ae91202014-03-10 19:21:25 -070027 MOCK_CONST_METHOD2(IsUpdateAllowedOver, bool(NetworkConnectionType type,
28 NetworkTethering tethering));
Jay Srinivasan43488792012-06-19 00:25:31 -070029
30 MOCK_CONST_METHOD1(StringForConnectionType,
31 const char*(NetworkConnectionType type));
Alex Deymo6ae91202014-03-10 19:21:25 -070032
33 MOCK_CONST_METHOD1(StringForTethering,
34 const char*(NetworkTethering tethering));
Jay Srinivasan43488792012-06-19 00:25:31 -070035};
36
37} // namespace chromeos_update_engine
38
39#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_