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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 | 136 |
137 // |SecondDiscoveryFindsHeartRateAdapter| | 137 // |SecondDiscoveryFindsHeartRateAdapter| |
138 // Inherits from |PoweredAdapter| | 138 // Inherits from |PoweredAdapter| |
139 // Mock Functions: | 139 // Mock Functions: |
140 // - StartDiscoverySessionWithFilter: | 140 // - StartDiscoverySessionWithFilter: |
141 // Run success callback with |DiscoverySession|. | 141 // Run success callback with |DiscoverySession|. |
142 // After the first call, adds a |HeartRateDevice|. | 142 // After the first call, adds a |HeartRateDevice|. |
143 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 143 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
144 GetSecondDiscoveryFindsHeartRateAdapter(); | 144 GetSecondDiscoveryFindsHeartRateAdapter(); |
145 | 145 |
146 // |DeviceEventAdapter| | |
147 // Inherits from |PoweredAdapter| | |
148 // Internal Structure: | |
149 // - Connected Heart Rate Device | |
150 // - IsGattConnected: Returns true. | |
151 // - UUIDs: | |
152 // - Heart Rate UUID (0x180d) | |
153 // - Changing Battery Device | |
154 // - IsGattConnected: Returns false. | |
155 // - No UUIDs (A Battery UUID (0x180f) is added by | |
156 // StartDiscoverySessionWithFilter). | |
157 // - Non Connected Tx Power Device | |
158 // - IsGattConnected: Returns false. | |
159 // - UUIDs: | |
160 // - Tx Power (0x1804) | |
161 // - Discovery Generic Access Device | |
162 // - IsGattConnected: Returns true. | |
163 // - No UUIDs (A Generic Access UUID (0x1800) us added by | |
scheib
2016/08/09 20:33:43
us -> is
ortuno
2016/08/09 22:03:44
Done.
| |
164 // StartDiscoverySessionWithFilter). | |
165 // Mock Functions: | |
166 // - StartDiscoverySessionWithFilter: Performs the following steps the first | |
167 // time is called: | |
168 // 1. Post a task to add New Glucose Device (Contains a single | |
169 // Glucose UUID (0x1808) and no services). | |
170 // 2. Adds a Battery UUID to Changing Battery Device and posts a task | |
171 // that notifies observers that the device changed. | |
172 // 3. Adds a Generic Access UUID to Discovery Generic Access Device and | |
173 // posts a task to Notify its services have been discovered. | |
174 // 4. Return a discovery session. | |
175 // Successive calls just return a discovery session. | |
176 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | |
177 GetDeviceEventAdapter(); | |
178 | |
146 // |MissingServiceHeartRateAdapter| | 179 // |MissingServiceHeartRateAdapter| |
147 // Inherits from |EmptyAdapter| | 180 // Inherits from |EmptyAdapter| |
148 // Internal Structure: | 181 // Internal Structure: |
149 // - Heart Rate Device | 182 // - Heart Rate Device |
150 // - UUIDs: | 183 // - UUIDs: |
151 // - Generic Access UUID (0x1800) | 184 // - Generic Access UUID (0x1800) |
152 // - Heart Rate UUID (0x180d) | 185 // - Heart Rate UUID (0x180d) |
153 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 186 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
154 GetMissingServiceHeartRateAdapter(); | 187 GetMissingServiceHeartRateAdapter(); |
155 | 188 |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 // - GetGattServices: | 447 // - GetGattServices: |
415 // Returns a list of all services added to the device. | 448 // Returns a list of all services added to the device. |
416 // - GetGattService: | 449 // - GetGattService: |
417 // Return a service matching the identifier provided if the service was | 450 // Return a service matching the identifier provided if the service was |
418 // added to the mock. | 451 // added to the mock. |
419 // - GetAddress: | 452 // - GetAddress: |
420 // Returns: address | 453 // Returns: address |
421 // - GetName: | 454 // - GetName: |
422 // Returns: device_name. | 455 // Returns: device_name. |
423 // - IsPaired: | 456 // - IsPaired: |
424 // Returns true. | 457 // Returns false. |
458 // - IsConnected: | |
459 // Returns false. | |
460 // - IsGattConnected: | |
461 // Returns false. | |
425 // - ConnectGatt: | 462 // - ConnectGatt: |
426 // Calls error callback with | 463 // Calls error callback with |
427 // BluetoothDevice::ConnectErrorCode::ERROR_UNSUPPORTED_DEVICE. | 464 // BluetoothDevice::ConnectErrorCode::ERROR_UNSUPPORTED_DEVICE. |
428 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> | 465 static std::unique_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
429 GetBaseDevice(device::MockBluetoothAdapter* adapter, | 466 GetBaseDevice(device::MockBluetoothAdapter* adapter, |
430 const char* device_name = "Base Device", | 467 const char* device_name = "Base Device", |
431 device::BluetoothDevice::UUIDList uuids = | 468 device::BluetoothDevice::UUIDList uuids = |
432 device::BluetoothDevice::UUIDList(), | 469 device::BluetoothDevice::UUIDList(), |
433 const std::string& address = "00:00:00:00:00:00"); | 470 const std::string& address = "00:00:00:00:00:00"); |
434 | 471 |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 | 722 |
686 // Function to turn an integer into an MAC address of the form | 723 // Function to turn an integer into an MAC address of the form |
687 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) | 724 // XX:XX:XX:XX:XX:XX. For example makeMACAddress(0xdeadbeef) |
688 // returns "00:00:DE:AD:BE:EF". | 725 // returns "00:00:DE:AD:BE:EF". |
689 static std::string makeMACAddress(uint64_t addr); | 726 static std::string makeMACAddress(uint64_t addr); |
690 }; | 727 }; |
691 | 728 |
692 } // namespace content | 729 } // namespace content |
693 | 730 |
694 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ | 731 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI DER_H_ |
OLD | NEW |