OLD | NEW |
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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // Internal Structure: | 288 // Internal Structure: |
289 // - Heart Rate Device | 289 // - Heart Rate Device |
290 // - UUIDs: | 290 // - UUIDs: |
291 // - Generic Access UUID (0x1800) | 291 // - Generic Access UUID (0x1800) |
292 // - Heart Rate UUID (0x180d) | 292 // - Heart Rate UUID (0x180d) |
293 // - Services: | 293 // - Services: |
294 // - Generic Access Service - Characteristics as described in | 294 // - Generic Access Service - Characteristics as described in |
295 // GetGenericAccessService. | 295 // GetGenericAccessService. |
296 // - Heart Rate Service - Characteristics as described in | 296 // - Heart Rate Service - Characteristics as described in |
297 // GetHeartRateService. | 297 // GetHeartRateService. |
298 // - Request Disconnection Service: | 298 // - Request Disconnection Service: - Characteristics as described in |
299 // - Request Disconnection Characteristic - A write will cause the | 299 // GetDisconnectingService |
300 // device to disconnect. | |
301 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 300 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
302 GetDisconnectingHeartRateAdapter(); | 301 GetDisconnectingHeartRateAdapter(); |
303 | 302 |
| 303 // |DisconnectingHealthThermometerAdapter| |
| 304 // Inherits from |EmptyAdapter| |
| 305 // Internal Structure: |
| 306 // - Disconnecting Health Thermometer Device |
| 307 // - UUIDs: |
| 308 // - Generic Access UUID (0x1800) |
| 309 // - Health Thermometer UUID (0x1809) |
| 310 // - Services: |
| 311 // - Generic Access Service - Characteristics as described in |
| 312 // GetGenericAccessService. |
| 313 // - Request Disconnection Service: - Characteristics as described in |
| 314 // GetDisconnectingService |
| 315 // - Health Thermometer: |
| 316 // - Measurement Interval (0x2a21): |
| 317 // - Read: Calls GattCharacteristicValueChanged and success |
| 318 // callback with [1]. |
| 319 // - GetProperties: Returns |
| 320 // BluetoothRemoteGattCharacteristic::PROPERTY_READ |
| 321 // TODO(crbug.com/608538): Mock Write and StartNotifySession. |
| 322 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
| 323 GetDisconnectingHealthThermometer(); |
| 324 |
304 // |ServicesDiscoveredAfterReconnectionAdapter|(disconnect) | 325 // |ServicesDiscoveredAfterReconnectionAdapter|(disconnect) |
305 // Inherits from |HeartRateAdapter| | 326 // Inherits from |HeartRateAdapter| |
306 // Internal Structure: | 327 // Internal Structure: |
307 // - Heart Rate Device | 328 // - Heart Rate Device |
308 // - UUIDs: | 329 // - UUIDs: |
309 // - Generic Access UUID (0x1800) | 330 // - Generic Access UUID (0x1800) |
310 // - Heart Rate UUID (0x180d) | 331 // - Heart Rate UUID (0x180d) |
311 // - Services: | 332 // - Services: |
312 // - Generic Access Service - Characteristics as described in | 333 // - Generic Access Service - Characteristics as described in |
313 // GetGenericAccessService. | 334 // GetGenericAccessService. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 // errorUUID(0xA5) | 453 // errorUUID(0xA5) |
433 // - ErrorCharacteristic( | 454 // - ErrorCharacteristic( |
434 // BluetoothRemoteGattService::GATT_ERROR_NOT_AUTHORIZED) | 455 // BluetoothRemoteGattService::GATT_ERROR_NOT_AUTHORIZED) |
435 // errorUUID(0xA6) | 456 // errorUUID(0xA6) |
436 // - ErrorCharacteristic( | 457 // - ErrorCharacteristic( |
437 // BluetoothRemoteGattService::GATT_ERROR_NOT_PAIRED) | 458 // BluetoothRemoteGattService::GATT_ERROR_NOT_PAIRED) |
438 // errorUUID(0xA7) | 459 // errorUUID(0xA7) |
439 // - ErrorCharacteristic( | 460 // - ErrorCharacteristic( |
440 // BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED) | 461 // BluetoothRemoteGattService::GATT_ERROR_NOT_SUPPORTED) |
441 // errorUUID(0xA8) | 462 // errorUUID(0xA8) |
| 463 // - Request Disconnection Service: - Characteristics as described in |
| 464 // GetDisconnectingService |
442 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 465 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
443 GetFailingGATTOperationsAdapter(); | 466 GetFailingGATTOperationsAdapter(); |
444 | 467 |
445 // Discovery Sessions | 468 // Discovery Sessions |
446 | 469 |
447 // |DiscoverySession| | 470 // |DiscoverySession| |
448 // Mock Functions: | 471 // Mock Functions: |
449 // - Stop: | 472 // - Stop: |
450 // Run success callback. | 473 // Run success callback. |
451 static std::unique_ptr< | 474 static std::unique_ptr< |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 // - Body Sensor Location (0x2a38) | 668 // - Body Sensor Location (0x2a38) |
646 // - Mock Functions: | 669 // - Mock Functions: |
647 // - Read: Calls GattCharacteristicValueChanged and success | 670 // - Read: Calls GattCharacteristicValueChanged and success |
648 // callback with [2] which corresponds to wrist. | 671 // callback with [2] which corresponds to wrist. |
649 // - GetProperties: Returns | 672 // - GetProperties: Returns |
650 // BluetoothRemoteGattCharacteristic::PROPERTY_READ | 673 // BluetoothRemoteGattCharacteristic::PROPERTY_READ |
651 static std::unique_ptr<testing::NiceMock<device::MockBluetoothGattService>> | 674 static std::unique_ptr<testing::NiceMock<device::MockBluetoothGattService>> |
652 GetHeartRateService(device::MockBluetoothAdapter* adapter, | 675 GetHeartRateService(device::MockBluetoothAdapter* adapter, |
653 device::MockBluetoothDevice* device); | 676 device::MockBluetoothDevice* device); |
654 | 677 |
| 678 // |DisconnectingService| |
| 679 // Internal Structure: |
| 680 // - Characteristics: |
| 681 // - Request Disconnection Characteristic ( |
| 682 // 01d7d889-7451-419f-aeb8-d65e7b9277af) |
| 683 // - Write: Sets the device to disconnected and calls DeviceChanged. |
| 684 static std::unique_ptr<testing::NiceMock<device::MockBluetoothGattService>> |
| 685 GetDisconnectingService(device::MockBluetoothAdapter* adapter, |
| 686 device::MockBluetoothDevice* device); |
| 687 |
655 // Characteristics | 688 // Characteristics |
656 | 689 |
657 // |BaseCharacteristic|(identifier, service, uuid) | 690 // |BaseCharacteristic|(identifier, service, uuid) |
658 // Descriptors added: | 691 // Descriptors added: |
659 // None. | 692 // None. |
660 // Mock Functions: | 693 // Mock Functions: |
661 // - TODO(ortuno): http://crbug.com/483347 GetDescriptors: | 694 // - TODO(ortuno): http://crbug.com/483347 GetDescriptors: |
662 // Returns: all descriptors added to the characteristic | 695 // Returns: all descriptors added to the characteristic |
663 // - TODO(ortuno): http://crbug.com/483347 GetDescriptor: | 696 // - TODO(ortuno): http://crbug.com/483347 GetDescriptor: |
664 // Returns the descriptor matching the identifier provided if the | 697 // Returns the descriptor matching the identifier provided if the |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 | 774 |
742 // Function to turn an integer into an MAC address of the form | 775 // Function to turn an integer into an MAC address of the form |
743 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 776 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
744 // returns "00:00:DE:AD:BE:EF". | 777 // returns "00:00:DE:AD:BE:EF". |
745 static std::string makeMACAddress(uint64_t addr); | 778 static std::string makeMACAddress(uint64_t addr); |
746 }; | 779 }; |
747 | 780 |
748 } // namespace content | 781 } // namespace content |
749 | 782 |
750 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 783 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
OLD | NEW |