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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 // |BaseGATTNotifySession|(characteristic_identifier) | 656 // |BaseGATTNotifySession|(characteristic_identifier) |
657 // Mock Functions: | 657 // Mock Functions: |
658 // - GetCharacteristicIdentifier: | 658 // - GetCharacteristicIdentifier: |
659 // Returns: characteristic_identifier | 659 // Returns: characteristic_identifier |
660 // - IsActive: | 660 // - IsActive: |
661 // Returns: true | 661 // Returns: true |
662 // - Stop: | 662 // - Stop: |
663 // Stops calling GattCharacteristicValueChanged and runs callback. | 663 // Stops calling GattCharacteristicValueChanged and runs callback. |
664 static std::unique_ptr< | 664 static std::unique_ptr< |
665 testing::NiceMock<device::MockBluetoothGattNotifySession>> | 665 testing::NiceMock<device::MockBluetoothGattNotifySession>> |
666 GetBaseGATTNotifySession(const std::string& characteristic_identifier); | 666 GetBaseGATTNotifySession( |
| 667 base::WeakPtr<device::BluetoothRemoteGattCharacteristic> characteristic); |
667 | 668 |
668 // Helper functions: | 669 // Helper functions: |
669 | 670 |
670 // DEPRECATED: This is a poor practice as it exposes the specific | 671 // DEPRECATED: This is a poor practice as it exposes the specific |
671 // enum values of this code base into the UUIDs used | 672 // enum values of this code base into the UUIDs used |
672 // by the test data. Prefer methods such as | 673 // by the test data. Prefer methods such as |
673 // connectErrorUUID. | 674 // connectErrorUUID. |
674 // errorUUID(alias) returns a UUID with the top 32 bits of | 675 // errorUUID(alias) returns a UUID with the top 32 bits of |
675 // "00000000-97e5-4cd7-b9f1-f5a427670c59" replaced with the bits of |alias|. | 676 // "00000000-97e5-4cd7-b9f1-f5a427670c59" replaced with the bits of |alias|. |
676 // For example, errorUUID(0xDEADBEEF) returns | 677 // For example, errorUUID(0xDEADBEEF) returns |
677 // "deadbeef-97e5-4cd7-b9f1-f5a427670c59". The bottom 96 bits of error UUIDs | 678 // "deadbeef-97e5-4cd7-b9f1-f5a427670c59". The bottom 96 bits of error UUIDs |
678 // were generated as a type 4 (random) UUID. | 679 // were generated as a type 4 (random) UUID. |
679 static std::string errorUUID(uint32_t alias); | 680 static std::string errorUUID(uint32_t alias); |
680 | 681 |
681 // Returns a stable test data UUID associated with a given | 682 // Returns a stable test data UUID associated with a given |
682 // BluetoothDevice::ConnectErrorCode. | 683 // BluetoothDevice::ConnectErrorCode. |
683 static device::BluetoothUUID connectErrorUUID( | 684 static device::BluetoothUUID connectErrorUUID( |
684 device::BluetoothDevice::ConnectErrorCode error_code); | 685 device::BluetoothDevice::ConnectErrorCode error_code); |
685 | 686 |
686 // Function to turn an integer into an MAC address of the form | 687 // Function to turn an integer into an MAC address of the form |
687 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 688 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
688 // returns "00:00:DE:AD:BE:EF". | 689 // returns "00:00:DE:AD:BE:EF". |
689 static std::string makeMACAddress(uint64_t addr); | 690 static std::string makeMACAddress(uint64_t addr); |
690 }; | 691 }; |
691 | 692 |
692 } // namespace content | 693 } // namespace content |
693 | 694 |
694 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 695 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
OLD | NEW |