| 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 // |BaseGATTNotifySession|(characteristic_identifier) | 594 // |BaseGATTNotifySession|(characteristic_identifier) |
| 595 // Mock Functions: | 595 // Mock Functions: |
| 596 // - GetCharacteristicIdentifier: | 596 // - GetCharacteristicIdentifier: |
| 597 // Returns: characteristic_identifier | 597 // Returns: characteristic_identifier |
| 598 // - IsActive: | 598 // - IsActive: |
| 599 // Returns: true | 599 // Returns: true |
| 600 // - Stop: | 600 // - Stop: |
| 601 // Stops calling GattCharacteristicValueChanged and runs callback. | 601 // Stops calling GattCharacteristicValueChanged and runs callback. |
| 602 static std::unique_ptr< | 602 static std::unique_ptr< |
| 603 testing::NiceMock<device::MockBluetoothGattNotifySession>> | 603 testing::NiceMock<device::MockBluetoothGattNotifySession>> |
| 604 GetBaseGATTNotifySession(const std::string& characteristic_identifier); | 604 GetBaseGATTNotifySession( |
| 605 base::WeakPtr<device::BluetoothRemoteGattCharacteristic> characteristic); |
| 605 | 606 |
| 606 // Helper functions: | 607 // Helper functions: |
| 607 | 608 |
| 608 // DEPRECATED: This is a poor practice as it exposes the specific | 609 // DEPRECATED: This is a poor practice as it exposes the specific |
| 609 // enum values of this code base into the UUIDs used | 610 // enum values of this code base into the UUIDs used |
| 610 // by the test data. Prefer methods such as | 611 // by the test data. Prefer methods such as |
| 611 // connectErrorUUID. | 612 // connectErrorUUID. |
| 612 // errorUUID(alias) returns a UUID with the top 32 bits of | 613 // errorUUID(alias) returns a UUID with the top 32 bits of |
| 613 // "00000000-97e5-4cd7-b9f1-f5a427670c59" replaced with the bits of |alias|. | 614 // "00000000-97e5-4cd7-b9f1-f5a427670c59" replaced with the bits of |alias|. |
| 614 // For example, errorUUID(0xDEADBEEF) returns | 615 // For example, errorUUID(0xDEADBEEF) returns |
| 615 // "deadbeef-97e5-4cd7-b9f1-f5a427670c59". The bottom 96 bits of error UUIDs | 616 // "deadbeef-97e5-4cd7-b9f1-f5a427670c59". The bottom 96 bits of error UUIDs |
| 616 // were generated as a type 4 (random) UUID. | 617 // were generated as a type 4 (random) UUID. |
| 617 static std::string errorUUID(uint32_t alias); | 618 static std::string errorUUID(uint32_t alias); |
| 618 | 619 |
| 619 // Returns a stable test data UUID associated with a given | 620 // Returns a stable test data UUID associated with a given |
| 620 // BluetoothDevice::ConnectErrorCode. | 621 // BluetoothDevice::ConnectErrorCode. |
| 621 static device::BluetoothUUID connectErrorUUID( | 622 static device::BluetoothUUID connectErrorUUID( |
| 622 device::BluetoothDevice::ConnectErrorCode error_code); | 623 device::BluetoothDevice::ConnectErrorCode error_code); |
| 623 | 624 |
| 624 // Function to turn an integer into an MAC address of the form | 625 // Function to turn an integer into an MAC address of the form |
| 625 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 626 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
| 626 // returns "00:00:DE:AD:BE:EF". | 627 // returns "00:00:DE:AD:BE:EF". |
| 627 static std::string makeMACAddress(uint64_t addr); | 628 static std::string makeMACAddress(uint64_t addr); |
| 628 }; | 629 }; |
| 629 | 630 |
| 630 } // namespace content | 631 } // namespace content |
| 631 | 632 |
| 632 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 633 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
| OLD | NEW |