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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // runs success callback with a new Gatt connection. When called | 338 // runs success callback with a new Gatt connection. When called |
339 // after IsGattDiscoveryComplete runs success callback with a new | 339 // after IsGattDiscoveryComplete runs success callback with a new |
340 // Gatt connection and notifies of services discovered. | 340 // Gatt connection and notifies of services discovered. |
341 // - IsGattDiscoveryComplete: The first time this function is called, | 341 // - IsGattDiscoveryComplete: The first time this function is called, |
342 // it adds two services (Generic Access and Heart Rate) and | 342 // it adds two services (Generic Access and Heart Rate) and |
343 // if |disconnect| is true disconnects the device and returns false. | 343 // if |disconnect| is true disconnects the device and returns false. |
344 // After that it just returns true. | 344 // After that it just returns true. |
345 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 345 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
346 GetServicesDiscoveredAfterReconnectionAdapter(bool disconnect); | 346 GetServicesDiscoveredAfterReconnectionAdapter(bool disconnect); |
347 | 347 |
| 348 // |GATTOperationFinishesAfterReconnectionAdapter|(disconnect, succeeds) |
| 349 // Inherits from |EmptyAdapter| |
| 350 // Internal Structure: |
| 351 // - Health Thermometer Device |
| 352 // - UUIDs: |
| 353 // - Generic Access UUID (0x1800) |
| 354 // - Health Thermometer UUID (0x1809) |
| 355 // - Services: |
| 356 // - Generic Access Service - Characteristics as described in |
| 357 // GetGenericAccessService. |
| 358 // - Health Thermometer |
| 359 // - Measurement Interval: |
| 360 // - Read: If |succeeds| is true, saves a succeeding callback, |
| 361 // otherwise it saves a failing callback. This callback |
| 362 // is run during CreateGattConnection. If |disconnect| is true |
| 363 // disconnects the device. |
| 364 // - CreateGattConnection: Runs success callback with a new GATT |
| 365 // connection and runs any pending GATT operation callbacks. |
| 366 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
| 367 GetGATTOperationFinishesAfterReconnectionAdapter(bool disconnect, |
| 368 bool succeeds); |
| 369 |
348 // |BlacklistTestAdapter| | 370 // |BlacklistTestAdapter| |
349 // Inherits from |EmptyAdapter| | 371 // Inherits from |EmptyAdapter| |
350 // Internal Structure: | 372 // Internal Structure: |
351 // - |ConnectableDevice|(adapter, "Blacklist Test Device", uuids) | 373 // - |ConnectableDevice|(adapter, "Blacklist Test Device", uuids) |
352 // - UUIDs: | 374 // - UUIDs: |
353 // - Blacklist Test Service UUID | 375 // - Blacklist Test Service UUID |
354 // (611c954a-263b-4f4a-aab6-01ddb953f985) | 376 // (611c954a-263b-4f4a-aab6-01ddb953f985) |
355 // - Device Information UUID (0x180a) | 377 // - Device Information UUID (0x180a) |
356 // - Generic Access UUID (0x1800) | 378 // - Generic Access UUID (0x1800) |
357 // - Heart Rate UUID (0x180d) | 379 // - Heart Rate UUID (0x180d) |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 | 796 |
775 // Function to turn an integer into an MAC address of the form | 797 // Function to turn an integer into an MAC address of the form |
776 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 798 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
777 // returns "00:00:DE:AD:BE:EF". | 799 // returns "00:00:DE:AD:BE:EF". |
778 static std::string makeMACAddress(uint64_t addr); | 800 static std::string makeMACAddress(uint64_t addr); |
779 }; | 801 }; |
780 | 802 |
781 } // namespace content | 803 } // namespace content |
782 | 804 |
783 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 805 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
OLD | NEW |