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

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: Address tkent's comments 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..285362527d4b9c9e9bce553a37bdf69db6e75b2c 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,23 @@ 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.
+ // TODO(ortuno): Remove the following 3 functions. This is a temporary hack to
+ // get layout tests working with Notifications.
+ // http://crbug.com/543884
+ void StartTestNotifications(MockBluetoothAdapter* adapter,
+ MockBluetoothGattCharacteristic* characteristic,
+ const std::vector<uint8_t>& value);
+ void StopTestNotifications();
+
private:
+ void DoNotify(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