| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium 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_DBUS_FAKE_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_FAKE_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "chromeos/chromeos_export.h" |
| 11 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h" |
| 12 |
| 13 namespace chromeos { |
| 14 |
| 15 // A fake implementation of ShillThirdPartyVpnDriverClient. |
| 16 // The client can generate fake DBus signals when |
| 17 // ShillThirdPartyVpnDriverClient::TestInterface methods are called. The |
| 18 // DBus methods are nops that only acknowledge the caller. |
| 19 class CHROMEOS_EXPORT FakeShillThirdPartyVpnDriverClient |
| 20 : public ShillThirdPartyVpnDriverClient, |
| 21 public ShillThirdPartyVpnDriverClient::TestInterface { |
| 22 public: |
| 23 FakeShillThirdPartyVpnDriverClient(); |
| 24 ~FakeShillThirdPartyVpnDriverClient() override; |
| 25 |
| 26 // ShillThirdPartyVpnDriverClient overrides |
| 27 void Init(dbus::Bus* bus) override; |
| 28 void AddShillThirdPartyVpnObserver( |
| 29 const dbus::ObjectPath& object_path, |
| 30 ShillThirdPartyVpnObserver* observer) override; |
| 31 void RemoveShillThirdPartyVpnObserver( |
| 32 const dbus::ObjectPath& object_path) override; |
| 33 void SetParameters( |
| 34 const dbus::ObjectPath& object_path, |
| 35 const base::DictionaryValue& parameters, |
| 36 const base::Closure& callback, |
| 37 const ShillClientHelper::ErrorCallback& error_callback) override; |
| 38 void UpdateConnectionState( |
| 39 const dbus::ObjectPath& object_path, |
| 40 const uint32_t connection_state, |
| 41 const base::Closure& callback, |
| 42 const ShillClientHelper::ErrorCallback& error_callback) override; |
| 43 void SendPacket( |
| 44 const dbus::ObjectPath& object_path, |
| 45 const std::string& ip_packet, |
| 46 const base::Closure& callback, |
| 47 const ShillClientHelper::ErrorCallback& error_callback) override; |
| 48 ShillThirdPartyVpnDriverClient::TestInterface* GetTestInterface() override; |
| 49 |
| 50 // ShillThirdPartyVpnDriverClient::TestInterface overrides |
| 51 void OnPacketReceived(const dbus::ObjectPath& object_path, |
| 52 const std::string& packet) override; |
| 53 void OnPlatformMessage(const dbus::ObjectPath& object_path, |
| 54 uint32_t message) override; |
| 55 |
| 56 private: |
| 57 using ObserverMap = std::map<std::string, ShillThirdPartyVpnObserver*>; |
| 58 |
| 59 ObserverMap observer_map_; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(FakeShillThirdPartyVpnDriverClient); |
| 62 }; |
| 63 |
| 64 } // namespace chromeos |
| 65 |
| 66 #endif // CHROMEOS_DBUS_FAKE_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_ |
| OLD | NEW |