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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 // |BaseGATTNotifySession|(characteristic_identifier) | 693 // |BaseGATTNotifySession|(characteristic_identifier) |
694 // Mock Functions: | 694 // Mock Functions: |
695 // - GetCharacteristicIdentifier: | 695 // - GetCharacteristicIdentifier: |
696 // Returns: characteristic_identifier | 696 // Returns: characteristic_identifier |
697 // - IsActive: | 697 // - IsActive: |
698 // Returns: true | 698 // Returns: true |
699 // - Stop: | 699 // - Stop: |
700 // Stops calling GattCharacteristicValueChanged and runs callback. | 700 // Stops calling GattCharacteristicValueChanged and runs callback. |
701 static std::unique_ptr< | 701 static std::unique_ptr< |
702 testing::NiceMock<device::MockBluetoothGattNotifySession>> | 702 testing::NiceMock<device::MockBluetoothGattNotifySession>> |
703 GetBaseGATTNotifySession( | 703 GetBaseGATTNotifySession(const std::string& characteristic_identifier); |
704 base::WeakPtr<device::BluetoothRemoteGattCharacteristic> characteristic); | |
705 | 704 |
706 // Helper functions: | 705 // Helper functions: |
707 | 706 |
708 // DEPRECATED: This is a poor practice as it exposes the specific | 707 // DEPRECATED: This is a poor practice as it exposes the specific |
709 // enum values of this code base into the UUIDs used | 708 // enum values of this code base into the UUIDs used |
710 // by the test data. Prefer methods such as | 709 // by the test data. Prefer methods such as |
711 // connectErrorUUID. | 710 // connectErrorUUID. |
712 // errorUUID(alias) returns a UUID with the top 32 bits of | 711 // errorUUID(alias) returns a UUID with the top 32 bits of |
713 // "00000000-97e5-4cd7-b9f1-f5a427670c59" replaced with the bits of |alias|. | 712 // "00000000-97e5-4cd7-b9f1-f5a427670c59" replaced with the bits of |alias|. |
714 // For example, errorUUID(0xDEADBEEF) returns | 713 // For example, errorUUID(0xDEADBEEF) returns |
715 // "deadbeef-97e5-4cd7-b9f1-f5a427670c59". The bottom 96 bits of error UUIDs | 714 // "deadbeef-97e5-4cd7-b9f1-f5a427670c59". The bottom 96 bits of error UUIDs |
716 // were generated as a type 4 (random) UUID. | 715 // were generated as a type 4 (random) UUID. |
717 static std::string errorUUID(uint32_t alias); | 716 static std::string errorUUID(uint32_t alias); |
718 | 717 |
719 // Returns a stable test data UUID associated with a given | 718 // Returns a stable test data UUID associated with a given |
720 // BluetoothDevice::ConnectErrorCode. | 719 // BluetoothDevice::ConnectErrorCode. |
721 static device::BluetoothUUID connectErrorUUID( | 720 static device::BluetoothUUID connectErrorUUID( |
722 device::BluetoothDevice::ConnectErrorCode error_code); | 721 device::BluetoothDevice::ConnectErrorCode error_code); |
723 | 722 |
724 // Function to turn an integer into an MAC address of the form | 723 // Function to turn an integer into an MAC address of the form |
725 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 724 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
726 // returns "00:00:DE:AD:BE:EF". | 725 // returns "00:00:DE:AD:BE:EF". |
727 static std::string makeMACAddress(uint64_t addr); | 726 static std::string makeMACAddress(uint64_t addr); |
728 }; | 727 }; |
729 | 728 |
730 } // namespace content | 729 } // namespace content |
731 | 730 |
732 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 731 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
OLD | NEW |