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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // - Generic Access UUID (0x1800) | 201 // - Generic Access UUID (0x1800) |
202 // - Heart Rate UUID (0x180d) | 202 // - Heart Rate UUID (0x180d) |
203 // - Services: | 203 // - Services: |
204 // - Generic Access Service - Characteristics as described in | 204 // - Generic Access Service - Characteristics as described in |
205 // GetGenericAccessService. | 205 // GetGenericAccessService. |
206 // - Heart Rate Service - Characteristics as described in | 206 // - Heart Rate Service - Characteristics as described in |
207 // GetHeartRateService. | 207 // GetHeartRateService. |
208 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 208 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
209 GetHeartRateAdapter(); | 209 GetHeartRateAdapter(); |
210 | 210 |
211 // |HeartRateAndHIDAdapter| | 211 // |BlacklistTestAdapter| |
212 // Inherits from |EmptyAdapter| | 212 // Inherits from |EmptyAdapter| |
213 // Internal Structure: | 213 // Internal Structure: |
214 // - |ConnectableDevice|(adapter, "Heart Rate And HID Device", uuids) | 214 // - |ConnectableDevice|(adapter, "Blacklist Test Device", uuids) |
215 // - UUIDs: | 215 // - UUIDs: |
| 216 // - Blacklist Test Service UUID |
| 217 // (611c954a-263b-4f4a-aab6-01ddb953f985) |
216 // - Device Information UUID (0x180a) | 218 // - Device Information UUID (0x180a) |
217 // - Generic Access UUID (0x1800) | 219 // - Generic Access UUID (0x1800) |
218 // - Heart Rate UUID (0x180d) | 220 // - Heart Rate UUID (0x180d) |
219 // - Human Interface Device UUID (0x1812) (a blacklisted service) | 221 // - Human Interface Device UUID (0x1812) (a blacklisted service) |
220 // - Services: | 222 // - Services: |
| 223 // - Blacklist Test Service - Characteristics as described in |
| 224 // GetBlacklistTestService. |
221 // - Device Information Service - Characteristics as described in | 225 // - Device Information Service - Characteristics as described in |
222 // GetDeviceInformationService. | 226 // GetDeviceInformationService. |
223 // - Generic Access Service - Characteristics as described in | 227 // - Generic Access Service - Characteristics as described in |
224 // GetGenericAccessService. | 228 // GetGenericAccessService. |
225 // - Heart Rate Service - Characteristics as described in | 229 // - Heart Rate Service - Characteristics as described in |
226 // GetHeartRateService. | 230 // GetHeartRateService. |
227 // - Human Interface Device Service - No characteristics needed | 231 // - Human Interface Device Service - No characteristics needed |
228 // because the service is blacklisted. | 232 // because the service is blacklisted. |
229 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 233 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
230 GetHeartRateAndHIDAdapter(); | 234 GetBlacklistTestAdapter(); |
231 | 235 |
232 // |DelayedServicesDiscoveryAdapter| | 236 // |DelayedServicesDiscoveryAdapter| |
233 // Inherits from |EmptyAdapter| | 237 // Inherits from |EmptyAdapter| |
234 // Internal Structure: | 238 // Internal Structure: |
235 // - Heart Rate Device | 239 // - Heart Rate Device |
236 // - Generic Access UUID (0x1800) | 240 // - Generic Access UUID (0x1800) |
237 // - Heart Rate UUID (0x180D) | 241 // - Heart Rate UUID (0x180D) |
238 // - Heart Rate Service (No services will be returned the first time | 242 // - Heart Rate Service (No services will be returned the first time |
239 // GetServices is called. Subsequent calls will | 243 // GetServices is called. Subsequent calls will |
240 // return the Heart Rate Service) | 244 // return the Heart Rate Service) |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // - IsLocal: | 456 // - IsLocal: |
453 // Returns: false | 457 // Returns: false |
454 // - IsPrimary: | 458 // - IsPrimary: |
455 // Returns: true | 459 // Returns: true |
456 // - GetDevice: | 460 // - GetDevice: |
457 // Returns: device | 461 // Returns: device |
458 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> | 462 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> |
459 GetBaseGATTService(device::MockBluetoothDevice* device, | 463 GetBaseGATTService(device::MockBluetoothDevice* device, |
460 const std::string& uuid); | 464 const std::string& uuid); |
461 | 465 |
462 // |GetDeviceInformationService| | 466 // |DeviceInformationService| |
463 // Internal Structure: | 467 // Internal Structure: |
464 // - Characteristics: | 468 // - Characteristics: |
465 // - Serial Number String: (a blacklisted characteristic) | 469 // - Serial Number String: (0x2a25) (a blacklisted characteristic) |
466 // - Mock Functions: | 470 // - Mock Functions: |
467 // - Read: Fails test. | 471 // - Read: Fails test. |
468 // - GetProperties: Returns | 472 // - GetProperties: Returns |
469 // BluetoothGattCharacteristic::PROPERTY_READ | 473 // BluetoothGattCharacteristic::PROPERTY_READ |
470 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> | 474 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> |
471 GetDeviceInformationService(device::MockBluetoothDevice* device); | 475 GetDeviceInformationService(device::MockBluetoothDevice* device); |
472 | 476 |
| 477 // |BlacklistTestService| |
| 478 // Internal Structure: |
| 479 // - Characteristics: |
| 480 // - Blacklist Exclude Reads Characteristic: |
| 481 // (bad1c9a2-9a5b-4015-8b60-1579bbbf2135) |
| 482 // - Mock Functions: |
| 483 // - Read: Fails test. |
| 484 // - Write: Calls success callback. |
| 485 // - GetProperties: Returns |
| 486 // BluetoothGattCharacteristic::PROPERTY_READ | |
| 487 // BluetoothGattCharacteristic::PROPERTY_WRITE |
| 488 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> |
| 489 GetBlacklistTestService(device::MockBluetoothDevice* device); |
| 490 |
473 // |GenericAccessService| | 491 // |GenericAccessService| |
474 // Internal Structure: | 492 // Internal Structure: |
475 // - Characteristics: | 493 // - Characteristics: |
476 // - Device Name: | 494 // - Device Name: (0x2A00) |
477 // - Mock Functions: | 495 // - Mock Functions: |
478 // - Read: Calls success callback with device's name. | 496 // - Read: Calls success callback with device's name. |
479 // - Write: Calls success callback. | 497 // - Write: Calls success callback. |
480 // - GetProperties: Returns | 498 // - GetProperties: Returns |
481 // BluetoothGattCharacteristic::PROPERTY_READ | | 499 // BluetoothGattCharacteristic::PROPERTY_READ | |
482 // BluetoothGattCharacteristic::PROPERTY_WRITE | 500 // BluetoothGattCharacteristic::PROPERTY_WRITE |
| 501 // - Peripheral Privacy Flag: (0x2A02) (blacklisted for writes) |
| 502 // - Mock Functions: |
| 503 // - Read: Calls success callback with boolean value 'false'. |
| 504 // - Write: Fails test. |
| 505 // - GetProperties: Returns |
| 506 // BluetoothGattCharacteristic::PROPERTY_READ | |
| 507 // BluetoothGattCharacteristic::PROPERTY_WRITE |
483 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> | 508 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> |
484 GetGenericAccessService(device::MockBluetoothDevice* device); | 509 GetGenericAccessService(device::MockBluetoothDevice* device); |
485 | 510 |
486 // |HeartRateService| | 511 // |HeartRateService| |
487 // Internal Structure: | 512 // Internal Structure: |
488 // - Characteristics: | 513 // - Characteristics: |
489 // - Heart Rate Measurement (0x2a37) | 514 // - Heart Rate Measurement (0x2a37) |
490 // - Mock Functions: | 515 // - Mock Functions: |
491 // - StartNotifySession: Sets a timer to call | 516 // - StartNotifySession: Sets a timer to call |
492 // GattCharacteristicValueChanged every 10ms and calls | 517 // GattCharacteristicValueChanged every 10ms and calls |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 | 610 |
586 // Function to turn an integer into an MAC address of the form | 611 // Function to turn an integer into an MAC address of the form |
587 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 612 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
588 // returns "00:00:DE:AD:BE:EF". | 613 // returns "00:00:DE:AD:BE:EF". |
589 static std::string makeMACAddress(uint64_t addr); | 614 static std::string makeMACAddress(uint64_t addr); |
590 }; | 615 }; |
591 | 616 |
592 } // namespace content | 617 } // namespace content |
593 | 618 |
594 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 619 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
OLD | NEW |