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

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

Issue 31513002: dbus: Remove MockShillDeviceClient and MockShillIPConfigClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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
(Empty)
1 // Copyright (c) 2013 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_SHILL_IPCONFIG_CLIENT_STUB_H_
6 #define CHROMEOS_DBUS_SHILL_IPCONFIG_CLIENT_STUB_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "chromeos/dbus/shill_ipconfig_client.h"
12
13 namespace chromeos {
14
15 // A stub implementation of ShillIPConfigClient.
16 class ShillIPConfigClientStub : public ShillIPConfigClient {
17 public:
18 ShillIPConfigClientStub();
19 virtual ~ShillIPConfigClientStub();
20
21 // ShillIPConfigClient overrides
22 virtual void Init(dbus::Bus* bus) OVERRIDE;
23 virtual void AddPropertyChangedObserver(
24 const dbus::ObjectPath& ipconfig_path,
25 ShillPropertyChangedObserver* observer) OVERRIDE;
26 virtual void RemovePropertyChangedObserver(
27 const dbus::ObjectPath& ipconfig_path,
28 ShillPropertyChangedObserver* observer) OVERRIDE;
29 virtual void Refresh(const dbus::ObjectPath& ipconfig_path,
30 const VoidDBusMethodCallback& callback) OVERRIDE;
31 virtual void GetProperties(const dbus::ObjectPath& ipconfig_path,
32 const DictionaryValueCallback& callback) OVERRIDE;
33 virtual void SetProperty(const dbus::ObjectPath& ipconfig_path,
34 const std::string& name,
35 const base::Value& value,
36 const VoidDBusMethodCallback& callback) OVERRIDE;
37 virtual void ClearProperty(const dbus::ObjectPath& ipconfig_path,
38 const std::string& name,
39 const VoidDBusMethodCallback& callback) OVERRIDE;
40 virtual void Remove(const dbus::ObjectPath& ipconfig_path,
41 const VoidDBusMethodCallback& callback) OVERRIDE;
42
43 private:
44 // Runs callback with |values|.
45 void PassProperties(const base::DictionaryValue* values,
46 const DictionaryValueCallback& callback) const;
47
48 // Dictionary of <ipconfig_path, property dictionaries>
49 base::DictionaryValue ipconfigs_;
50
51 // Note: This should remain the last member so it'll be destroyed and
52 // invalidate its weak pointers before any other members are destroyed.
53 base::WeakPtrFactory<ShillIPConfigClientStub> weak_ptr_factory_;
54
55 DISALLOW_COPY_AND_ASSIGN(ShillIPConfigClientStub);
56 };
57
58 } // namespace chromeos
59
60 #endif // CHROMEOS_DBUS_SHILL_IPCONFIG_CLIENT_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698