| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // Returns: address | 387 // Returns: address |
| 388 // - GetName: | 388 // - GetName: |
| 389 // Returns: device_name. | 389 // Returns: device_name. |
| 390 // - IsPaired: | 390 // - IsPaired: |
| 391 // Returns true. | 391 // Returns true. |
| 392 // - ConnectGatt: | 392 // - ConnectGatt: |
| 393 // Calls error callback with | 393 // Calls error callback with |
| 394 // BluetoothDevice::ConnectErrorCode::ERROR_UNSUPPORTED_DEVICE. | 394 // BluetoothDevice::ConnectErrorCode::ERROR_UNSUPPORTED_DEVICE. |
| 395 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> | 395 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
| 396 GetBaseDevice(device::MockBluetoothAdapter* adapter, | 396 GetBaseDevice(device::MockBluetoothAdapter* adapter, |
| 397 const std::string& device_name = "Base Device", | 397 const char* device_name = "Base Device", |
| 398 device::BluetoothDevice::UUIDList uuids = | 398 device::BluetoothDevice::UUIDList uuids = |
| 399 device::BluetoothDevice::UUIDList(), | 399 device::BluetoothDevice::UUIDList(), |
| 400 const std::string& address = "00:00:00:00:00:00"); | 400 const std::string& address = "00:00:00:00:00:00"); |
| 401 | 401 |
| 402 // |BatteryDevice| | 402 // |BatteryDevice| |
| 403 // Inherits from |BaseDevice|(adapter, "Battery Device", uuids, | 403 // Inherits from |BaseDevice|(adapter, "Battery Device", uuids, |
| 404 // "00:00:00:00:00:01") | 404 // "00:00:00:00:00:01") |
| 405 // UUIDs added: | 405 // UUIDs added: |
| 406 // - Battery Service UUID (0x180F) | 406 // - Battery Service UUID (0x180F) |
| 407 // Services added: | 407 // Services added: |
| (...skipping 18 matching lines...) Expand all Loading... |
| 426 // UUIDs added: | 426 // UUIDs added: |
| 427 // None. | 427 // None. |
| 428 // Services added: | 428 // Services added: |
| 429 // None. | 429 // None. |
| 430 // Mock Functions: | 430 // Mock Functions: |
| 431 // - CreateGattConnection: | 431 // - CreateGattConnection: |
| 432 // - Run success callback with BaseGATTConnection | 432 // - Run success callback with BaseGATTConnection |
| 433 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> | 433 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
| 434 GetConnectableDevice( | 434 GetConnectableDevice( |
| 435 device::MockBluetoothAdapter* adapter, | 435 device::MockBluetoothAdapter* adapter, |
| 436 const std::string& device_name = "Connectable Device", | 436 const char* device_name = "Connectable Device", |
| 437 device::BluetoothDevice::UUIDList = device::BluetoothDevice::UUIDList(), | 437 device::BluetoothDevice::UUIDList = device::BluetoothDevice::UUIDList(), |
| 438 const std::string& address = "00:00:00:00:00:00"); | 438 const std::string& address = "00:00:00:00:00:00"); |
| 439 | 439 |
| 440 // |UnconnectableDevice| | 440 // |UnconnectableDevice| |
| 441 // Inherits from |BaseDevice|(adapter, device_name) | 441 // Inherits from |BaseDevice|(adapter, device_name) |
| 442 // UUIDs added: | 442 // UUIDs added: |
| 443 // - errorUUID(error_code) | 443 // - errorUUID(error_code) |
| 444 // Services added: | 444 // Services added: |
| 445 // None. | 445 // None. |
| 446 // Mock Functions: | 446 // Mock Functions: |
| 447 // - CreateGATTConnection: | 447 // - CreateGATTConnection: |
| 448 // - Run error callback with error_type | 448 // - Run error callback with error_type |
| 449 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> | 449 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
| 450 GetUnconnectableDevice( | 450 GetUnconnectableDevice(device::MockBluetoothAdapter* adapter, |
| 451 device::MockBluetoothAdapter* adapter, | 451 device::BluetoothDevice::ConnectErrorCode error_code, |
| 452 device::BluetoothDevice::ConnectErrorCode error_code, | 452 const char* device_name = "Unconnectable Device"); |
| 453 const std::string& device_name = "Unconnectable Device"); | |
| 454 | 453 |
| 455 // |HeartRateDevice| | 454 // |HeartRateDevice| |
| 456 // Inherits from |ConnectableDevice|(adapter, "Heart Rate Device", uuids) | 455 // Inherits from |ConnectableDevice|(adapter, "Heart Rate Device", uuids) |
| 457 // UUIDs added: | 456 // UUIDs added: |
| 458 // - Generic Access (0x1800) | 457 // - Generic Access (0x1800) |
| 459 // - Heart Rate UUID (0x180D) | 458 // - Heart Rate UUID (0x180D) |
| 460 // Services added: | 459 // Services added: |
| 461 // None. Each user of the HeartRateDevice is in charge of adding the | 460 // None. Each user of the HeartRateDevice is in charge of adding the |
| 462 // relevant services, characteristics and descriptors. | 461 // relevant services, characteristics and descriptors. |
| 463 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> | 462 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 | 645 |
| 647 // Function to turn an integer into an MAC address of the form | 646 // Function to turn an integer into an MAC address of the form |
| 648 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 647 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
| 649 // returns "00:00:DE:AD:BE:EF". | 648 // returns "00:00:DE:AD:BE:EF". |
| 650 static std::string makeMACAddress(uint64_t addr); | 649 static std::string makeMACAddress(uint64_t addr); |
| 651 }; | 650 }; |
| 652 | 651 |
| 653 } // namespace content | 652 } // namespace content |
| 654 | 653 |
| 655 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 654 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
| OLD | NEW |