Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: chromeos/dbus/fake_shill_ipconfig_client.h

Issue 267433005: Provide IPConfigs in networkingPrivate.GetProperties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_IPCONFIG_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_FAKE_SHILL_IPCONFIG_CLIENT_H_
6 #define CHROMEOS_DBUS_FAKE_SHILL_IPCONFIG_CLIENT_H_ 6 #define CHROMEOS_DBUS_FAKE_SHILL_IPCONFIG_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_ipconfig_client.h" 12 #include "chromeos/dbus/shill_ipconfig_client.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 // A fake implementation of ShillIPConfigClient. 16 // A fake implementation of ShillIPConfigClient.
17 class CHROMEOS_EXPORT FakeShillIPConfigClient : public ShillIPConfigClient { 17 class CHROMEOS_EXPORT FakeShillIPConfigClient
18 : public ShillIPConfigClient,
19 public ShillIPConfigClient::TestInterface {
18 public: 20 public:
19 FakeShillIPConfigClient(); 21 FakeShillIPConfigClient();
20 virtual ~FakeShillIPConfigClient(); 22 virtual ~FakeShillIPConfigClient();
21 23
22 // ShillIPConfigClient overrides 24 // ShillIPConfigClient overrides
23 virtual void Init(dbus::Bus* bus) OVERRIDE; 25 virtual void Init(dbus::Bus* bus) OVERRIDE;
24 virtual void AddPropertyChangedObserver( 26 virtual void AddPropertyChangedObserver(
25 const dbus::ObjectPath& ipconfig_path, 27 const dbus::ObjectPath& ipconfig_path,
26 ShillPropertyChangedObserver* observer) OVERRIDE; 28 ShillPropertyChangedObserver* observer) OVERRIDE;
27 virtual void RemovePropertyChangedObserver( 29 virtual void RemovePropertyChangedObserver(
28 const dbus::ObjectPath& ipconfig_path, 30 const dbus::ObjectPath& ipconfig_path,
29 ShillPropertyChangedObserver* observer) OVERRIDE; 31 ShillPropertyChangedObserver* observer) OVERRIDE;
30 virtual void Refresh(const dbus::ObjectPath& ipconfig_path, 32 virtual void Refresh(const dbus::ObjectPath& ipconfig_path,
31 const VoidDBusMethodCallback& callback) OVERRIDE; 33 const VoidDBusMethodCallback& callback) OVERRIDE;
32 virtual void GetProperties(const dbus::ObjectPath& ipconfig_path, 34 virtual void GetProperties(const dbus::ObjectPath& ipconfig_path,
33 const DictionaryValueCallback& callback) OVERRIDE; 35 const DictionaryValueCallback& callback) OVERRIDE;
34 virtual void SetProperty(const dbus::ObjectPath& ipconfig_path, 36 virtual void SetProperty(const dbus::ObjectPath& ipconfig_path,
35 const std::string& name, 37 const std::string& name,
36 const base::Value& value, 38 const base::Value& value,
37 const VoidDBusMethodCallback& callback) OVERRIDE; 39 const VoidDBusMethodCallback& callback) OVERRIDE;
38 virtual void ClearProperty(const dbus::ObjectPath& ipconfig_path, 40 virtual void ClearProperty(const dbus::ObjectPath& ipconfig_path,
39 const std::string& name, 41 const std::string& name,
40 const VoidDBusMethodCallback& callback) OVERRIDE; 42 const VoidDBusMethodCallback& callback) OVERRIDE;
41 virtual void Remove(const dbus::ObjectPath& ipconfig_path, 43 virtual void Remove(const dbus::ObjectPath& ipconfig_path,
42 const VoidDBusMethodCallback& callback) OVERRIDE; 44 const VoidDBusMethodCallback& callback) OVERRIDE;
45 virtual ShillIPConfigClient::TestInterface* GetTestInterface() OVERRIDE;
46
47 // ShillIPConfigClient::TestInterface overrides.
48 virtual void AddIPConfig(const std::string& ip_config_path,
49 const base::DictionaryValue& properties) OVERRIDE;
43 50
44 private: 51 private:
45 // Runs callback with |values|. 52 // Runs callback with |values|.
46 void PassProperties(const base::DictionaryValue* values, 53 void PassProperties(const base::DictionaryValue* values,
47 const DictionaryValueCallback& callback) const; 54 const DictionaryValueCallback& callback) const;
48 55
49 // Dictionary of <ipconfig_path, property dictionaries> 56 // Dictionary of <ipconfig_path, property dictionaries>
50 base::DictionaryValue ipconfigs_; 57 base::DictionaryValue ipconfigs_;
51 58
52 // Note: This should remain the last member so it'll be destroyed and 59 // Note: This should remain the last member so it'll be destroyed and
53 // invalidate its weak pointers before any other members are destroyed. 60 // invalidate its weak pointers before any other members are destroyed.
54 base::WeakPtrFactory<FakeShillIPConfigClient> weak_ptr_factory_; 61 base::WeakPtrFactory<FakeShillIPConfigClient> weak_ptr_factory_;
55 62
56 DISALLOW_COPY_AND_ASSIGN(FakeShillIPConfigClient); 63 DISALLOW_COPY_AND_ASSIGN(FakeShillIPConfigClient);
57 }; 64 };
58 65
59 } // namespace chromeos 66 } // namespace chromeos
60 67
61 #endif // CHROMEOS_DBUS_FAKE_SHILL_IPCONFIG_CLIENT_H_ 68 #endif // CHROMEOS_DBUS_FAKE_SHILL_IPCONFIG_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/networking/test.js ('k') | chromeos/dbus/fake_shill_ipconfig_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698