blob: 522e1f619bce82c94e4ce3474fa238aa53e4d6f4 [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
22 MOCK_CONST_METHOD2(GetConnectionType, bool(DbusGlibInterface* dbus_iface,
23 NetworkConnectionType* out_type));
24
25 MOCK_CONST_METHOD1(IsUpdateAllowedOver, bool(NetworkConnectionType type));
26
27 MOCK_CONST_METHOD1(StringForConnectionType,
28 const char*(NetworkConnectionType type));
29};
30
31} // namespace chromeos_update_engine
32
33#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_