| 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 // to call GattCharacteristicValueChanged from js. | 496 // to call GattCharacteristicValueChanged from js. |
| 497 // https://crbug.com/543884 | 497 // https://crbug.com/543884 |
| 498 // - GetProperties: Returns | 498 // - GetProperties: Returns |
| 499 // BluetoothGattCharacteristic::PROPERTY_NOTIFY | 499 // BluetoothGattCharacteristic::PROPERTY_NOTIFY |
| 500 // - Body Sensor Location (0x2a38) | 500 // - Body Sensor Location (0x2a38) |
| 501 // - Mock Functions: | 501 // - Mock Functions: |
| 502 // - Read: Calls GattCharacteristicValueChanged and success | 502 // - Read: Calls GattCharacteristicValueChanged and success |
| 503 // callback with [1] which corresponds to chest. | 503 // callback with [1] which corresponds to chest. |
| 504 // - GetProperties: Returns | 504 // - GetProperties: Returns |
| 505 // BluetoothGattCharacteristic::PROPERTY_READ | 505 // BluetoothGattCharacteristic::PROPERTY_READ |
| 506 // - Body Sensor Location (0x2a38) |
| 507 // - Mock Functions: |
| 508 // - Read: Calls GattCharacteristicValueChanged and success |
| 509 // callback with [2] which corresponds to wrist. |
| 510 // - GetProperties: Returns |
| 511 // BluetoothGattCharacteristic::PROPERTY_READ |
| 506 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> | 512 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattService>> |
| 507 GetHeartRateService(device::MockBluetoothAdapter* adapter, | 513 GetHeartRateService(device::MockBluetoothAdapter* adapter, |
| 508 device::MockBluetoothDevice* device); | 514 device::MockBluetoothDevice* device); |
| 509 | 515 |
| 510 // Characteristics | 516 // Characteristics |
| 511 | 517 |
| 512 // |BaseCharacteristic|(service, uuid) | 518 // |BaseCharacteristic|(identifier, service, uuid) |
| 513 // Descriptors added: | 519 // Descriptors added: |
| 514 // None. | 520 // None. |
| 515 // Mock Functions: | 521 // Mock Functions: |
| 516 // - TODO(ortuno): http://crbug.com/483347 GetDescriptors: | 522 // - TODO(ortuno): http://crbug.com/483347 GetDescriptors: |
| 517 // Returns: all descriptors added to the characteristic | 523 // Returns: all descriptors added to the characteristic |
| 518 // - TODO(ortuno): http://crbug.com/483347 GetDescriptor: | 524 // - TODO(ortuno): http://crbug.com/483347 GetDescriptor: |
| 519 // Returns the descriptor matching the identifier provided if the | 525 // Returns the descriptor matching the identifier provided if the |
| 520 // descriptor was added to the characteristic. | 526 // descriptor was added to the characteristic. |
| 521 // - GetIdentifier: | 527 // - GetIdentifier: |
| 522 // Returns: uuid + “ Identifier” | 528 // Returns: identifier |
| 523 // - GetUUID: | 529 // - GetUUID: |
| 524 // Returns: uuid | 530 // Returns: uuid |
| 525 // - IsLocal: | 531 // - IsLocal: |
| 526 // Returns: false | 532 // Returns: false |
| 527 // - GetService: | 533 // - GetService: |
| 528 // Returns: service | 534 // Returns: service |
| 529 // - GetProperties: | 535 // - GetProperties: |
| 530 // Returns: NULL | 536 // Returns: NULL |
| 531 // - GetPermissions: | 537 // - GetPermissions: |
| 532 // Returns: NULL | 538 // Returns: NULL |
| 533 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattCharacteristic>> | 539 static scoped_ptr<testing::NiceMock<device::MockBluetoothGattCharacteristic>> |
| 534 GetBaseGATTCharacteristic( | 540 GetBaseGATTCharacteristic( |
| 541 const std::string& identifier, |
| 535 device::MockBluetoothGattService* service, | 542 device::MockBluetoothGattService* service, |
| 536 const std::string& uuid, | 543 const std::string& uuid, |
| 537 device::BluetoothGattCharacteristic::Properties properties); | 544 device::BluetoothGattCharacteristic::Properties properties); |
| 538 | 545 |
| 539 // |ErrorCharacteristic|(service, error_type) | 546 // |ErrorCharacteristic|(service, error_type) |
| 540 // Inherits from BaseCharacteristic(service, errorUUID(error_type + 0xA1)) | 547 // Inherits from BaseCharacteristic(service, errorUUID(error_type + 0xA1)) |
| 541 // Descriptors added: | 548 // Descriptors added: |
| 542 // None. | 549 // None. |
| 543 // Mock Functions: | 550 // Mock Functions: |
| 544 // - ReadRemoteCharacteristic: | 551 // - ReadRemoteCharacteristic: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 592 |
| 586 // Function to turn an integer into an MAC address of the form | 593 // Function to turn an integer into an MAC address of the form |
| 587 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 594 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
| 588 // returns "00:00:DE:AD:BE:EF". | 595 // returns "00:00:DE:AD:BE:EF". |
| 589 static std::string makeMACAddress(uint64_t addr); | 596 static std::string makeMACAddress(uint64_t addr); |
| 590 }; | 597 }; |
| 591 | 598 |
| 592 } // namespace content | 599 } // namespace content |
| 593 | 600 |
| 594 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 601 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
| OLD | NEW |