Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h

Issue 2051333004: Implement BluetoothGattNotifySession::Stop on Android, 2nd attempt (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address new review comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(const std::string& characteristic_identifier); 703 GetBaseGATTNotifySession(
704 base::WeakPtr<device::BluetoothRemoteGattCharacteristic> characteristic);
704 705
705 // Helper functions: 706 // Helper functions:
706 707
707 // DEPRECATED: This is a poor practice as it exposes the specific 708 // DEPRECATED: This is a poor practice as it exposes the specific
708 // enum values of this code base into the UUIDs used 709 // enum values of this code base into the UUIDs used
709 // by the test data. Prefer methods such as 710 // by the test data. Prefer methods such as
710 // connectErrorUUID. 711 // connectErrorUUID.
711 // errorUUID(alias) returns a UUID with the top 32 bits of 712 // errorUUID(alias) returns a UUID with the top 32 bits of
712 // "00000000-97e5-4cd7-b9f1-f5a427670c59" replaced with the bits of |alias|. 713 // "00000000-97e5-4cd7-b9f1-f5a427670c59" replaced with the bits of |alias|.
713 // For example, errorUUID(0xDEADBEEF) returns 714 // For example, errorUUID(0xDEADBEEF) returns
714 // "deadbeef-97e5-4cd7-b9f1-f5a427670c59". The bottom 96 bits of error UUIDs 715 // "deadbeef-97e5-4cd7-b9f1-f5a427670c59". The bottom 96 bits of error UUIDs
715 // were generated as a type 4 (random) UUID. 716 // were generated as a type 4 (random) UUID.
716 static std::string errorUUID(uint32_t alias); 717 static std::string errorUUID(uint32_t alias);
717 718
718 // Returns a stable test data UUID associated with a given 719 // Returns a stable test data UUID associated with a given
719 // BluetoothDevice::ConnectErrorCode. 720 // BluetoothDevice::ConnectErrorCode.
720 static device::BluetoothUUID connectErrorUUID( 721 static device::BluetoothUUID connectErrorUUID(
721 device::BluetoothDevice::ConnectErrorCode error_code); 722 device::BluetoothDevice::ConnectErrorCode error_code);
722 723
723 // Function to turn an integer into an MAC address of the form 724 // Function to turn an integer into an MAC address of the form
724 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) 725 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef)
725 // returns "00:00:DE:AD:BE:EF". 726 // returns "00:00:DE:AD:BE:EF".
726 static std::string makeMACAddress(uint64_t addr); 727 static std::string makeMACAddress(uint64_t addr);
727 }; 728 };
728 729
729 } // namespace content 730 } // namespace content
730 731
731 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ 732 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698