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

Unified Diff: device/bluetooth/test/mock_bluetooth_gatt_notify_session.h

Issue 1382743002: bluetooth: Add characteristicvaluechanged event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-notifications-1
Patch Set: Final clean up Created 5 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 side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/test/mock_bluetooth_gatt_notify_session.h
diff --git a/device/bluetooth/test/mock_bluetooth_gatt_notify_session.h b/device/bluetooth/test/mock_bluetooth_gatt_notify_session.h
index 97c28e7bb6ef5f0bd33148b46c7c2a3e568cd3f8..c60a8421eba398002e5c9edf2d2d06f9e7d1c251 100644
--- a/device/bluetooth/test/mock_bluetooth_gatt_notify_session.h
+++ b/device/bluetooth/test/mock_bluetooth_gatt_notify_session.h
@@ -8,11 +8,15 @@
#include <string>
#include "base/callback.h"
+#include "base/timer/timer.h"
#include "device/bluetooth/bluetooth_gatt_notify_session.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace device {
+class MockBluetoothAdapter;
+class MockBluetoothGattCharacteristic;
+
class MockBluetoothGattNotifySession : public BluetoothGattNotifySession {
public:
explicit MockBluetoothGattNotifySession(
@@ -23,7 +27,20 @@ class MockBluetoothGattNotifySession : public BluetoothGattNotifySession {
MOCK_METHOD0(IsActive, bool());
MOCK_METHOD1(Stop, void(const base::Closure&));
+ // Starts notifying the adapter's observers that the characteristic's value
+ // changed.
+ void StartTestNotifications(MockBluetoothAdapter* adapter,
+ MockBluetoothGattCharacteristic* characteristic,
+ const std::vector<uint8_t>& value);
+ void StopTestNotifications();
+
private:
+ void TestNotify(MockBluetoothAdapter* adapter,
+ MockBluetoothGattCharacteristic* characteristic,
+ const std::vector<uint8_t>& value);
+
+ base::RepeatingTimer test_notifications_timer_;
+
DISALLOW_COPY_AND_ASSIGN(MockBluetoothGattNotifySession);
};

Powered by Google App Engine
This is Rietveld 408576698