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 "base/callback.h" | 8 #include "base/callback.h" |
9 #include "device/bluetooth/bluetooth_adapter_factory.h" | 9 #include "device/bluetooth/bluetooth_adapter_factory.h" |
10 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 10 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 GetEmptyAdapter(); | 31 GetEmptyAdapter(); |
32 | 32 |
33 // Returns "SingleEmptyDevice" fake BluetoothAdapter with the following | 33 // Returns "SingleEmptyDevice" fake BluetoothAdapter with the following |
34 // characteristics: | 34 // characteristics: |
35 // - |StartDiscoverySession| runs the first argument with |DiscoverySession| | 35 // - |StartDiscoverySession| runs the first argument with |DiscoverySession| |
36 // as argument. | 36 // as argument. |
37 // - |GetDevices| returns a list with an |EmptyDevice|. | 37 // - |GetDevices| returns a list with an |EmptyDevice|. |
38 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> | 38 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
39 GetSingleEmptyDeviceAdapter(); | 39 GetSingleEmptyDeviceAdapter(); |
40 | 40 |
41 // Returns a fake DiscoverySession with the following characteristics: | 41 // Returns "ConnectableDeviceAdapter" fake BluetoothAdapter with the |
| 42 // following characteristics: |
| 43 // - |StartDiscoverySession| runs the first argument with |DiscoverySession| |
| 44 // as argument. |
| 45 // - |GetDevices| returns a list with a |ConnectableDevice|. |
| 46 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
| 47 GetConnectableDeviceAdapter(); |
| 48 |
| 49 // Returns "UnconnectableDeviceAdapter" fake BluetoothAdapter with the |
| 50 // following characteristics: |
| 51 // - |StartDiscoverySession| runs the first argument with |DiscoverySession| |
| 52 // as argument. |
| 53 // - |GetDevices| returns a list with an |UnconnectableDevice|. |
| 54 static scoped_refptr<testing::NiceMock<device::MockBluetoothAdapter>> |
| 55 GetUnconnectableDeviceAdapter(); |
| 56 |
| 57 // Returns a fake |DiscoverySession| with the following characteristics: |
42 // - |Stop| runs the first argument. | 58 // - |Stop| runs the first argument. |
43 static scoped_ptr<testing::NiceMock<device::MockBluetoothDiscoverySession>> | 59 static scoped_ptr<testing::NiceMock<device::MockBluetoothDiscoverySession>> |
44 GetDiscoverySession(); | 60 GetDiscoverySession(); |
45 | 61 |
46 // Returns an |EmptyDevice| with the following characeteristics: | 62 // Returns an |EmptyDevice| with the following characeteristics: |
47 // - |GetAddress| returns "Empty Mock Device instanceID". | 63 // - |GetAddress| returns "Empty Mock Device instanceID". |
48 // - |GetName| returns "Empty Mock Device name". | 64 // - |GetName| returns "Empty Mock Device name". |
49 // - |GetBluetoothClass| returns 0x1F00. "Unspecified Device Class": see | 65 // - |GetBluetoothClass| returns 0x1F00. "Unspecified Device Class": see |
50 // bluetooth.org/en-us/specification/assigned-numbers/baseband | 66 // bluetooth.org/en-us/specification/assigned-numbers/baseband |
51 // - |GetVendorIDSource| returns |BluetoothDevice::VENDOR_ID_BLUETOOTH|. | 67 // - |GetVendorIDSource| returns |BluetoothDevice::VENDOR_ID_BLUETOOTH|. |
52 // - |GetVendorID| returns 0xFFFF. | 68 // - |GetVendorID| returns 0xFFFF. |
53 // - |GetProductID| returns 1. | 69 // - |GetProductID| returns 1. |
54 // - |GetDeviceID| returns 2. | 70 // - |GetDeviceID| returns 2. |
55 // - |IsPaired| returns true. | 71 // - |IsPaired| returns true. |
56 // - |GetUUIDs| returns a list with two UUIDs: "1800" and "1801". | 72 // - |GetUUIDs| returns a list with two UUIDs: "1800" and "1801". |
57 static scoped_ptr<testing::NiceMock<device::MockBluetoothDevice>> | 73 static scoped_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
58 GetEmptyDevice(device::MockBluetoothAdapter* adapter); | 74 GetEmptyDevice(device::MockBluetoothAdapter* adapter); |
| 75 |
| 76 // Returns a fake |ConnectableDevice| with the same characteristics as |
| 77 // |EmptyDevice| except: |
| 78 // - |CreateGattConnection| runs success callback with a |
| 79 // fake BluetoothGattConnection as argument. |
| 80 static scoped_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
| 81 GetConnectableDevice(device::MockBluetoothAdapter* adapter); |
| 82 |
| 83 // Returns a fake |UnconnectableDevice| with the same characteristics as |
| 84 // |EmptyDevice| except: |
| 85 // - |CreateGattConnection| runs error callback with |
| 86 // |BluetoothDevice::ERROR_FAILED| as argument. |
| 87 static scoped_ptr<testing::NiceMock<device::MockBluetoothDevice>> |
| 88 GetUnconnectableDevice(device::MockBluetoothAdapter* adapter); |
59 }; | 89 }; |
60 | 90 |
61 } // namespace content | 91 } // namespace content |
62 | 92 |
63 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ | 93 #endif // CONTENT_SHELL_BROWSER_LAYOUT_TEST_LAYOUT_TEST_BLUETOOTH_ADAPTER_PROVI
DER_H_ |
OLD | NEW |