blob: 609b51dc849e944ffc039334c8b4a072ef99ce57 [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
Gilad Arnoldcf175a02014-07-10 16:48:47 -07005#ifndef UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_
6#define UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_
Jay Srinivasan43488792012-06-19 00:25:31 -07007
8#include <gmock/gmock.h>
9
Alex Deymof6ee0162015-07-31 12:35:22 -070010#include "update_engine/connection_manager_interface.h"
Jay Srinivasan43488792012-06-19 00:25:31 -070011
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.
Alex Deymof6ee0162015-07-31 12:35:22 -070017class MockConnectionManager : public ConnectionManagerInterface {
Jay Srinivasan43488792012-06-19 00:25:31 -070018 public:
Alex Deymof6ee0162015-07-31 12:35:22 -070019 MockConnectionManager() = default;
Jay Srinivasan43488792012-06-19 00:25:31 -070020
Alex Deymo6ae91202014-03-10 19:21:25 -070021 MOCK_CONST_METHOD3(GetConnectionProperties,
22 bool(DBusWrapperInterface* dbus_iface,
23 NetworkConnectionType* out_type,
24 NetworkTethering* out_tethering));
Jay Srinivasan43488792012-06-19 00:25:31 -070025
Alex Deymo6ae91202014-03-10 19:21:25 -070026 MOCK_CONST_METHOD2(IsUpdateAllowedOver, bool(NetworkConnectionType type,
27 NetworkTethering tethering));
Jay Srinivasan43488792012-06-19 00:25:31 -070028};
29
30} // namespace chromeos_update_engine
31
Gilad Arnoldcf175a02014-07-10 16:48:47 -070032#endif // UPDATE_ENGINE_MOCK_CONNECTION_MANAGER_H_