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

Unified Diff: chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h

Issue 206443009: chromeos/dbus: Add fake D-Bus clients for GATT client-mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h
diff --git a/chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h b/chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..dd9f7af8fa6282a10aaec3a0366b19fa8bd5279f
--- /dev/null
+++ b/chromeos/dbus/fake_bluetooth_gatt_descriptor_client.h
@@ -0,0 +1,57 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_
+#define CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_
+
+#include "base/observer_list.h"
+#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/bluetooth_gatt_descriptor_client.h"
+
+namespace chromeos {
+
+// FakeBluetoothGattDescriptorClient simulates the behavior of the Bluetooth
+// Daemon GATT characteristic descriptor objects and is used in test cases in
+// place of a mock and on the Linux desktop.
+class CHROMEOS_EXPORT FakeBluetoothGattDescriptorClient
+ : public BluetoothGattDescriptorClient {
+ public:
+ struct Properties : public BluetoothGattDescriptorClient::Properties {
+ explicit Properties(const PropertyChangedCallback& callback);
+ virtual ~Properties();
+
+ // dbus::PropertySet override
+ virtual void Get(dbus::PropertyBase* property,
+ dbus::PropertySet::GetCallback callback) OVERRIDE;
+ virtual void GetAll() OVERRIDE;
+ virtual void Set(dbus::PropertyBase* property,
+ dbus::PropertySet::SetCallback callback) OVERRIDE;
+ };
+
+ FakeBluetoothGattDescriptorClient();
+ virtual ~FakeBluetoothGattDescriptorClient();
+
+ // DBusClient override.
+ virtual void Init(dbus::Bus* bus) OVERRIDE;
+
+ // BluetoothGattDescriptorClient overrides.
+ virtual void AddObserver(Observer* observer) OVERRIDE;
+ virtual void RemoveObserver(Observer* observer) OVERRIDE;
+ virtual std::vector<dbus::ObjectPath> GetDescriptors() OVERRIDE;
+ virtual Properties* GetProperties(const dbus::ObjectPath& object_path)
+ OVERRIDE;
+
+ private:
+ // TODO(armansito): Add simulated descriptors, once BlueZ's behavior is
+ // better defined.
+
+ // List of observers interested in event notifications from us.
+ ObserverList<Observer> observers_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeBluetoothGattDescriptorClient);
+};
+
+} // namespace chromeos
+
+#endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_GATT_DESCRIPTOR_CLIENT_H_
« no previous file with comments | « chromeos/dbus/fake_bluetooth_gatt_characteristic_client.cc ('k') | chromeos/dbus/fake_bluetooth_gatt_descriptor_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698