Roll src/third_party/WebKit 75a2fa9:2546356 (svn 202272:202273)
[chromium-blink-merge.git] / chromeos / dbus / fake_shill_third_party_vpn_driver_client.h
blob18a3f21d11d5e7eb86dd9599f406b0e3340be740
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.
5 #ifndef CHROMEOS_DBUS_FAKE_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_
8 #include <stdint.h>
10 #include "chromeos/chromeos_export.h"
11 #include "chromeos/dbus/shill_third_party_vpn_driver_client.h"
13 namespace chromeos {
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;
26 // ShillThirdPartyVpnDriverClient overrides
27 void Init(dbus::Bus* bus) override;
28 void AddShillThirdPartyVpnObserver(
29 const std::string& object_path_value,
30 ShillThirdPartyVpnObserver* observer) override;
31 void RemoveShillThirdPartyVpnObserver(
32 const std::string& object_path_value) override;
33 void SetParameters(
34 const std::string& object_path_value,
35 const base::DictionaryValue& parameters,
36 const ShillClientHelper::StringCallback& callback,
37 const ShillClientHelper::ErrorCallback& error_callback) override;
38 void UpdateConnectionState(
39 const std::string& object_path_value,
40 const uint32_t connection_state,
41 const base::Closure& callback,
42 const ShillClientHelper::ErrorCallback& error_callback) override;
43 void SendPacket(
44 const std::string& object_path_value,
45 const std::vector<char>& ip_packet,
46 const base::Closure& callback,
47 const ShillClientHelper::ErrorCallback& error_callback) override;
48 ShillThirdPartyVpnDriverClient::TestInterface* GetTestInterface() override;
50 // ShillThirdPartyVpnDriverClient::TestInterface overrides
51 void OnPacketReceived(const std::string& object_path_value,
52 const std::vector<char>& packet) override;
53 void OnPlatformMessage(const std::string& object_path_value,
54 uint32_t message) override;
56 private:
57 using ObserverMap = std::map<std::string, ShillThirdPartyVpnObserver*>;
59 ObserverMap observer_map_;
61 DISALLOW_COPY_AND_ASSIGN(FakeShillThirdPartyVpnDriverClient);
64 } // namespace chromeos
66 #endif // CHROMEOS_DBUS_FAKE_SHILL_THIRD_PARTY_VPN_DRIVER_CLIENT_H_