OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
6 #define CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
12 #include "chromeos/dbus/shill_device_client.h" | 12 #include "chromeos/dbus/shill_device_client.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 | 15 |
16 // A fake implementation of ShillDeviceClient. | 16 // A fake implementation of ShillDeviceClient. |
17 // Implemented: Stub cellular device for SMS testing. | 17 // Implemented: Stub cellular device for SMS testing. |
18 class CHROMEOS_EXPORT FakeShillDeviceClient | 18 class CHROMEOS_EXPORT FakeShillDeviceClient |
19 : public ShillDeviceClient, | 19 : public ShillDeviceClient, |
20 public ShillDeviceClient::TestInterface { | 20 public ShillDeviceClient::TestInterface { |
21 public: | 21 public: |
22 FakeShillDeviceClient(); | 22 FakeShillDeviceClient(); |
23 virtual ~FakeShillDeviceClient(); | 23 virtual ~FakeShillDeviceClient(); |
24 | 24 |
25 // ShillDeviceClient overrides | 25 // ShillDeviceClient overrides |
26 virtual void Init(dbus::Bus* bus) OVERRIDE; | 26 virtual void Init(dbus::Bus* bus) override; |
27 virtual void AddPropertyChangedObserver( | 27 virtual void AddPropertyChangedObserver( |
28 const dbus::ObjectPath& device_path, | 28 const dbus::ObjectPath& device_path, |
29 ShillPropertyChangedObserver* observer) OVERRIDE; | 29 ShillPropertyChangedObserver* observer) override; |
30 virtual void RemovePropertyChangedObserver( | 30 virtual void RemovePropertyChangedObserver( |
31 const dbus::ObjectPath& device_path, | 31 const dbus::ObjectPath& device_path, |
32 ShillPropertyChangedObserver* observer) OVERRIDE; | 32 ShillPropertyChangedObserver* observer) override; |
33 virtual void GetProperties(const dbus::ObjectPath& device_path, | 33 virtual void GetProperties(const dbus::ObjectPath& device_path, |
34 const DictionaryValueCallback& callback) OVERRIDE; | 34 const DictionaryValueCallback& callback) override; |
35 virtual void ProposeScan(const dbus::ObjectPath& device_path, | 35 virtual void ProposeScan(const dbus::ObjectPath& device_path, |
36 const VoidDBusMethodCallback& callback) OVERRIDE; | 36 const VoidDBusMethodCallback& callback) override; |
37 virtual void SetProperty(const dbus::ObjectPath& device_path, | 37 virtual void SetProperty(const dbus::ObjectPath& device_path, |
38 const std::string& name, | 38 const std::string& name, |
39 const base::Value& value, | 39 const base::Value& value, |
40 const base::Closure& callback, | 40 const base::Closure& callback, |
41 const ErrorCallback& error_callback) OVERRIDE; | 41 const ErrorCallback& error_callback) override; |
42 virtual void ClearProperty(const dbus::ObjectPath& device_path, | 42 virtual void ClearProperty(const dbus::ObjectPath& device_path, |
43 const std::string& name, | 43 const std::string& name, |
44 const VoidDBusMethodCallback& callback) OVERRIDE; | 44 const VoidDBusMethodCallback& callback) override; |
45 virtual void AddIPConfig( | 45 virtual void AddIPConfig( |
46 const dbus::ObjectPath& device_path, | 46 const dbus::ObjectPath& device_path, |
47 const std::string& method, | 47 const std::string& method, |
48 const ObjectPathDBusMethodCallback& callback) OVERRIDE; | 48 const ObjectPathDBusMethodCallback& callback) override; |
49 virtual void RequirePin(const dbus::ObjectPath& device_path, | 49 virtual void RequirePin(const dbus::ObjectPath& device_path, |
50 const std::string& pin, | 50 const std::string& pin, |
51 bool require, | 51 bool require, |
52 const base::Closure& callback, | 52 const base::Closure& callback, |
53 const ErrorCallback& error_callback) OVERRIDE; | 53 const ErrorCallback& error_callback) override; |
54 virtual void EnterPin(const dbus::ObjectPath& device_path, | 54 virtual void EnterPin(const dbus::ObjectPath& device_path, |
55 const std::string& pin, | 55 const std::string& pin, |
56 const base::Closure& callback, | 56 const base::Closure& callback, |
57 const ErrorCallback& error_callback) OVERRIDE; | 57 const ErrorCallback& error_callback) override; |
58 virtual void UnblockPin(const dbus::ObjectPath& device_path, | 58 virtual void UnblockPin(const dbus::ObjectPath& device_path, |
59 const std::string& puk, | 59 const std::string& puk, |
60 const std::string& pin, | 60 const std::string& pin, |
61 const base::Closure& callback, | 61 const base::Closure& callback, |
62 const ErrorCallback& error_callback) OVERRIDE; | 62 const ErrorCallback& error_callback) override; |
63 virtual void ChangePin(const dbus::ObjectPath& device_path, | 63 virtual void ChangePin(const dbus::ObjectPath& device_path, |
64 const std::string& old_pin, | 64 const std::string& old_pin, |
65 const std::string& new_pin, | 65 const std::string& new_pin, |
66 const base::Closure& callback, | 66 const base::Closure& callback, |
67 const ErrorCallback& error_callback) OVERRIDE; | 67 const ErrorCallback& error_callback) override; |
68 virtual void Register(const dbus::ObjectPath& device_path, | 68 virtual void Register(const dbus::ObjectPath& device_path, |
69 const std::string& network_id, | 69 const std::string& network_id, |
70 const base::Closure& callback, | 70 const base::Closure& callback, |
71 const ErrorCallback& error_callback) OVERRIDE; | 71 const ErrorCallback& error_callback) override; |
72 virtual void SetCarrier(const dbus::ObjectPath& device_path, | 72 virtual void SetCarrier(const dbus::ObjectPath& device_path, |
73 const std::string& carrier, | 73 const std::string& carrier, |
74 const base::Closure& callback, | 74 const base::Closure& callback, |
75 const ErrorCallback& error_callback) OVERRIDE; | 75 const ErrorCallback& error_callback) override; |
76 virtual void Reset(const dbus::ObjectPath& device_path, | 76 virtual void Reset(const dbus::ObjectPath& device_path, |
77 const base::Closure& callback, | 77 const base::Closure& callback, |
78 const ErrorCallback& error_callback) OVERRIDE; | 78 const ErrorCallback& error_callback) override; |
79 virtual void PerformTDLSOperation( | 79 virtual void PerformTDLSOperation( |
80 const dbus::ObjectPath& device_path, | 80 const dbus::ObjectPath& device_path, |
81 const std::string& operation, | 81 const std::string& operation, |
82 const std::string& peer, | 82 const std::string& peer, |
83 const StringCallback& callback, | 83 const StringCallback& callback, |
84 const ErrorCallback& error_callback) OVERRIDE; | 84 const ErrorCallback& error_callback) override; |
85 | 85 |
86 virtual ShillDeviceClient::TestInterface* GetTestInterface() OVERRIDE; | 86 virtual ShillDeviceClient::TestInterface* GetTestInterface() override; |
87 | 87 |
88 // ShillDeviceClient::TestInterface overrides. | 88 // ShillDeviceClient::TestInterface overrides. |
89 virtual void AddDevice(const std::string& device_path, | 89 virtual void AddDevice(const std::string& device_path, |
90 const std::string& type, | 90 const std::string& type, |
91 const std::string& name) OVERRIDE; | 91 const std::string& name) override; |
92 virtual void RemoveDevice(const std::string& device_path) OVERRIDE; | 92 virtual void RemoveDevice(const std::string& device_path) override; |
93 virtual void ClearDevices() OVERRIDE; | 93 virtual void ClearDevices() override; |
94 virtual void SetDeviceProperty(const std::string& device_path, | 94 virtual void SetDeviceProperty(const std::string& device_path, |
95 const std::string& name, | 95 const std::string& name, |
96 const base::Value& value) OVERRIDE; | 96 const base::Value& value) override; |
97 virtual std::string GetDevicePathForType(const std::string& type) OVERRIDE; | 97 virtual std::string GetDevicePathForType(const std::string& type) override; |
98 | 98 |
99 void set_tdls_busy_count(int count) { tdls_busy_count_ = count; } | 99 void set_tdls_busy_count(int count) { tdls_busy_count_ = count; } |
100 | 100 |
101 private: | 101 private: |
102 typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList; | 102 typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList; |
103 | 103 |
104 void SetDefaultProperties(); | 104 void SetDefaultProperties(); |
105 void PassStubDeviceProperties(const dbus::ObjectPath& device_path, | 105 void PassStubDeviceProperties(const dbus::ObjectPath& device_path, |
106 const DictionaryValueCallback& callback) const; | 106 const DictionaryValueCallback& callback) const; |
107 | 107 |
(...skipping 16 matching lines...) Expand all Loading... |
124 // Note: This should remain the last member so it'll be destroyed and | 124 // Note: This should remain the last member so it'll be destroyed and |
125 // invalidate its weak pointers before any other members are destroyed. | 125 // invalidate its weak pointers before any other members are destroyed. |
126 base::WeakPtrFactory<FakeShillDeviceClient> weak_ptr_factory_; | 126 base::WeakPtrFactory<FakeShillDeviceClient> weak_ptr_factory_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); | 128 DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); |
129 }; | 129 }; |
130 | 130 |
131 } // namespace chromeos | 131 } // namespace chromeos |
132 | 132 |
133 #endif // CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 133 #endif // CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
OLD | NEW |