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

Unified Diff: device/bluetooth/test/mock_bluetooth_cbservice_mac.mm

Issue 1950033002: bluetooth: mac: Initial BluetoothRemoteGattCharacteristicMac implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@servicescan_cleanup
Patch Set: Updating the characteristic property conversion Created 4 years, 6 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_cbservice_mac.mm
diff --git a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
index 48337c8e95a47e31605d4d70dc1e1dd502f15133..a13be146fa69c1372dc87e53968f7d12fc41ec8f 100644
--- a/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_cbservice_mac.mm
@@ -7,6 +7,7 @@
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h"
#include "device/bluetooth/test/bluetooth_test.h"
+#include "device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h"
using base::mac::ObjCCast;
using base::scoped_nsobject;
@@ -14,6 +15,7 @@ using base::scoped_nsobject;
@interface MockCBService () {
scoped_nsobject<CBUUID> _UUID;
BOOL _primary;
+ scoped_nsobject<NSMutableArray> _characteristics;
}
@end
@@ -27,6 +29,7 @@ using base::scoped_nsobject;
if (self) {
_UUID.reset([uuid retain]);
_primary = isPrimary;
+ _characteristics.reset([[NSMutableArray alloc] init]);
}
return self;
}
@@ -51,8 +54,19 @@ using base::scoped_nsobject;
return _UUID.get();
}
+- (void)addCharacteristicWithUUID:(CBUUID*)cb_uuid properties:(int)properties {
+ scoped_nsobject<MockCBCharacteristic> characteristic_mock(
+ [[MockCBCharacteristic alloc] initWithCBUUID:cb_uuid
+ properties:properties]);
+ [_characteristics.get() addObject:characteristic_mock];
+}
+
- (CBService*)service {
return ObjCCast<CBService>(self);
}
+- (NSArray*)characteristics {
+ return _characteristics.get();
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698