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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // - Generic Access UUID (0x1800) | 175 // - Generic Access UUID (0x1800) |
176 // - Heart Rate UUID (0x180d) | 176 // - Heart Rate UUID (0x180d) |
177 // - Services: | 177 // - Services: |
178 // - Generic Access Service - Characteristics as described in | 178 // - Generic Access Service - Characteristics as described in |
179 // GetGenericAccessService. | 179 // GetGenericAccessService. |
180 // - Heart Rate Service - Characteristics as described in | 180 // - Heart Rate Service - Characteristics as described in |
181 // GetHeartRateService. | 181 // GetHeartRateService. |
182 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 182 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
183 GetHeartRateAdapter(); | 183 GetHeartRateAdapter(); |
184 | 184 |
| 185 // |GetEmptyNameHeartRateAdapter| |
| 186 // Inherits from |EmptyAdapter| |
| 187 // Internal Structure: |
| 188 // - Heart Rate Device |
| 189 // - UUIDs: |
| 190 // - Generic Access UUID (0x1800) |
| 191 // - Heart Rate UUID (0x180d) |
| 192 // - Services: |
| 193 // - Generic Access Service - Characteristics as described in |
| 194 // GetGenericAccessService. |
| 195 // - gap.device_name returns an empty string. |
| 196 // - Heart Rate Service - Characteristics as described in |
| 197 // GetHeartRateService. |
| 198 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
| 199 GetEmptyNameHeartRateAdapter(); |
| 200 |
| 201 // |GetNoNameHeartRateAdapter| |
| 202 // Inherits from |EmptyAdapter| |
| 203 // Internal Structure: |
| 204 // - Heart Rate Device |
| 205 // - GetName returns base::null_opt. |
| 206 // - UUIDs: |
| 207 // - Generic Access UUID (0x1800) |
| 208 // - Heart Rate UUID (0x180d) |
| 209 // - Services: |
| 210 // - Generic Access Service - Characteristics as described in |
| 211 // GetGenericAccessService. |
| 212 // - gap.device_name returns an empty string. |
| 213 // - Heart Rate Service - Characteristics as described in |
| 214 // GetHeartRateService. |
| 215 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
| 216 GetNoNameHeartRateAdapter(); |
| 217 |
185 // |TwoHeartRateServicesAdapter| | 218 // |TwoHeartRateServicesAdapter| |
186 // Inherits from |EmptyAdapter| | 219 // Inherits from |EmptyAdapter| |
187 // Internal Structure: | 220 // Internal Structure: |
188 // - Heart Rate Device | 221 // - Heart Rate Device |
189 // - UUIDs: | 222 // - UUIDs: |
190 // - Generic Access UUID (0x1800) | 223 // - Generic Access UUID (0x1800) |
191 // - Heart Rate UUID (0x180d) | 224 // - Heart Rate UUID (0x180d) |
192 // - Heart Rate UUID (0x180d) | 225 // - Heart Rate UUID (0x180d) |
193 // - Services: | 226 // - Services: |
194 // - Generic Access Service - Characteristics as described in | 227 // - Generic Access Service - Characteristics as described in |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 | 486 |
454 // |HeartRateDevice| | 487 // |HeartRateDevice| |
455 // Inherits from |ConnectableDevice|(adapter, "Heart Rate Device", uuids) | 488 // Inherits from |ConnectableDevice|(adapter, "Heart Rate Device", uuids) |
456 // UUIDs added: | 489 // UUIDs added: |
457 // - Generic Access (0x1800) | 490 // - Generic Access (0x1800) |
458 // - Heart Rate UUID (0x180D) | 491 // - Heart Rate UUID (0x180D) |
459 // Services added: | 492 // Services added: |
460 // None. Each user of the HeartRateDevice is in charge of adding the | 493 // None. Each user of the HeartRateDevice is in charge of adding the |
461 // relevant services, characteristics and descriptors. | 494 // relevant services, characteristics and descriptors. |
462 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> | 495 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
463 GetHeartRateDevice(device::MockBluetoothAdapter* adapter); | 496 GetHeartRateDevice(device::MockBluetoothAdapter* adapter, |
| 497 const char* device_name = "Heart Rate Device"); |
464 | 498 |
465 // Services | 499 // Services |
466 | 500 |
467 // |BaseGATTService|(identifier, device, uuid) | 501 // |BaseGATTService|(identifier, device, uuid) |
468 // Characteristics added: | 502 // Characteristics added: |
469 // None. | 503 // None. |
470 // Mock Functions: | 504 // Mock Functions: |
471 // - GetCharacteristics: | 505 // - GetCharacteristics: |
472 // Returns a list with all the characteristics added to the service | 506 // Returns a list with all the characteristics added to the service |
473 // - GetCharacteristic: | 507 // - GetCharacteristic: |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 | 679 |
646 // Function to turn an integer into an MAC address of the form | 680 // Function to turn an integer into an MAC address of the form |
647 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 681 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
648 // returns "00:00:DE:AD:BE:EF". | 682 // returns "00:00:DE:AD:BE:EF". |
649 static std::string makeMACAddress(uint64_t addr); | 683 static std::string makeMACAddress(uint64_t addr); |
650 }; | 684 }; |
651 | 685 |
652 } // namespace content | 686 } // namespace content |
653 | 687 |
654 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 688 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
OLD | NEW |