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

Side by Side Diff: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h

Issue 1403723004: bluetooth: Implement BluetoothCharacteristicProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-query-cache
Patch Set: Address scheib'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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_ 5 #ifndef CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_
6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_ 6 #define CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVIDER _H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "device/bluetooth/test/mock_bluetooth_adapter.h" 9 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
10 #include "device/bluetooth/test/mock_bluetooth_device.h" 10 #include "device/bluetooth/test/mock_bluetooth_device.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // |GenericAccessAdapter| 151 // |GenericAccessAdapter|
152 // Inherits from |EmptyAdapter| 152 // Inherits from |EmptyAdapter|
153 // Internal Structure: 153 // Internal Structure:
154 // - Generic Access Device 154 // - Generic Access Device
155 // - Generic Access UUID (0x1800) 155 // - Generic Access UUID (0x1800)
156 // - Generic Access Service 156 // - Generic Access Service
157 // - Device Name Characteristic: 157 // - Device Name Characteristic:
158 // - Mock Functions: 158 // - Mock Functions:
159 // - Read: Calls success callback with device's name. 159 // - Read: Calls success callback with device's name.
160 // - Write: Calls success callback. 160 // - Write: Calls success callback.
161 // - GetProperties: Returns
162 // BluetoothGattCharacteristic::PROPERTY_READ |
163 // BluetoothGattCharacteristic::PROPERTY_WRITE
161 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> 164 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
162 GetGenericAccessAdapter(); 165 GetGenericAccessAdapter();
163 166
164 // |HeartRateAdapter| 167 // |HeartRateAdapter|
165 // Inherits from |EmptyAdapter| 168 // Inherits from |EmptyAdapter|
166 // Internal Structure: 169 // Internal Structure:
167 // - Heart Rate Device 170 // - Heart Rate Device
168 // - Generic Access UUID (0x1800) 171 // - Generic Access UUID (0x1800)
169 // - Heart Rate UUID (0x180D) 172 // - Heart Rate UUID (0x180D)
170 // - Heart Rate Service 173 // - Heart Rate Service
171 // - Body Sensor Location 174 // - Body Sensor Location
172 // - Mock Functions: 175 // - Mock Functions:
173 // - Read: Calls GattCharacteristicValueChanged and success 176 // - Read: Calls GattCharacteristicValueChanged and success
174 // callback with [1] which corresponds to chest. 177 // callback with [1] which corresponds to chest.
178 // - GetProperties: Returns
179 // BluetoothGattCharacteristic::PROPERTY_READ
175 // - Heart Rate Measurement Characteristic: 180 // - Heart Rate Measurement Characteristic:
176 // - Mock Functions: 181 // - Mock Functions:
182 // - GetProperties: Returns
183 // BluetoothGattCharacteristic::PROPERTY_NOTIFY
177 // - StartNotifySession: Sets a timer to call 184 // - StartNotifySession: Sets a timer to call
178 // GattCharacteristicValueChanged every 10ms and calls success 185 // GattCharacteristicValueChanged every 10ms and calls success
179 // callback with a 186 // callback with a
180 // BaseGATTNotifySession(characteristic_instance_id) 187 // BaseGATTNotifySession(characteristic_instance_id)
181 // TODO: Instead of a timer we should be able to tell 188 // TODO: Instead of a timer we should be able to tell
182 // the fake adapter to call GattCharacteristicValueChanged 189 // the fake adapter to call GattCharacteristicValueChanged
183 // from js. 190 // from js.
184 // https://crbug.com/543884 191 // https://crbug.com/543884
185 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> 192 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
186 GetHeartRateAdapter(); 193 GetHeartRateAdapter();
(...skipping 17 matching lines...) Expand all
204 // errorUUID(0x7) 211 // errorUUID(0x7)
205 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> 212 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>>
206 GetFailingConnectionsAdapter(); 213 GetFailingConnectionsAdapter();
207 214
208 // |FailingGATTOperationsAdapter| 215 // |FailingGATTOperationsAdapter|
209 // Inherits from |EmptyAdapter| 216 // Inherits from |EmptyAdapter|
210 // FailingGATTOperationsAdapter holds a device with one 217 // FailingGATTOperationsAdapter holds a device with one
211 // service: ErrorsService. This service contains a characteristic for each 218 // service: ErrorsService. This service contains a characteristic for each
212 // type of GATT Error that can be thrown. Trying to write or read from these 219 // type of GATT Error that can be thrown. Trying to write or read from these
213 // characteristics results in the corresponding error being returned. 220 // characteristics results in the corresponding error being returned.
221 // GetProperties returns the following for all characteristics:
222 // (BluetoothGattCharacteristic::PROPERTY_READ |
223 // BluetoothGattCharacteristic::PROPERTY_WRITE |
224 // BluetoothGattCharacteristic::PROPERTY_INDICATE)
214 // Internal Structure: 225 // Internal Structure:
215 // - ErrorsDevice 226 // - ErrorsDevice
216 // - ErrorsService errorUUID(0xA0) 227 // - ErrorsService errorUUID(0xA0)
217 // - ErrorCharacteristic( 228 // - ErrorCharacteristic(
218 // BluetoothGattService::GATT_ERROR_UNKNOWN) 229 // BluetoothGattService::GATT_ERROR_UNKNOWN)
219 // errorUUID(0xA1) 230 // errorUUID(0xA1)
220 // - ErrorCharacteristic( 231 // - ErrorCharacteristic(
221 // BluetoothGattService::GATT_ERROR_FAILED) 232 // BluetoothGattService::GATT_ERROR_FAILED)
222 // errorUUID(0xA2) 233 // errorUUID(0xA2)
223 // - ErrorCharacteristic( 234 // - ErrorCharacteristic(
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 // Returns: uuid 418 // Returns: uuid
408 // - IsLocal: 419 // - IsLocal:
409 // Returns: false 420 // Returns: false
410 // - GetService: 421 // - GetService:
411 // Returns: service 422 // Returns: service
412 // - GetProperties: 423 // - GetProperties:
413 // Returns: NULL 424 // Returns: NULL
414 // - GetPermissions: 425 // - GetPermissions:
415 // Returns: NULL 426 // Returns: NULL
416 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattCharacteristic>> 427 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattCharacteristic>>
417 GetBaseGATTCharacteristic(device::MockBluetoothGattService* service, 428 GetBaseGATTCharacteristic(
418 const std::string& uuid); 429 device::MockBluetoothGattService* service,
430 const std::string& uuid,
431 device::BluetoothGattCharacteristic::Properties properties);
419 432
420 // |ErrorCharacteristic|(service, error_type) 433 // |ErrorCharacteristic|(service, error_type)
421 // Inherits from BaseCharacteristic(service, errorUUID(error_type + 0xA1)) 434 // Inherits from BaseCharacteristic(service, errorUUID(error_type + 0xA1))
422 // Descriptors added: 435 // Descriptors added:
423 // None. 436 // None.
424 // Mock Functions: 437 // Mock Functions:
425 // - ReadRemoteCharacteristic: 438 // - ReadRemoteCharacteristic:
426 // Run error callback with error_type 439 // Run error callback with error_type
427 // - WriteRemoteCharacteristic: 440 // - WriteRemoteCharacteristic:
428 // Run error callback with error_type 441 // Run error callback with error_type
(...skipping 28 matching lines...) Expand all
457 470
458 // Function to turn an integer into an MAC address of the form 471 // Function to turn an integer into an MAC address of the form
459 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) 472 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef)
460 // returns "00:00:DE:AD:BE:EF". 473 // returns "00:00:DE:AD:BE:EF".
461 static std::string makeMACAddress(uint64_t addr); 474 static std::string makeMACAddress(uint64_t addr);
462 }; 475 };
463 476
464 } // namespace content 477 } // namespace content
465 478
466 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ 479 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698