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 DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ | 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ |
6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ | 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 BluetoothRemoteGattDescriptor* descriptor) override; | 88 BluetoothRemoteGattDescriptor* descriptor) override; |
89 | 89 |
90 void SimulateGattDescriptorWrite( | 90 void SimulateGattDescriptorWrite( |
91 BluetoothRemoteGattDescriptor* descriptor) override; | 91 BluetoothRemoteGattDescriptor* descriptor) override; |
92 void SimulateGattDescriptorWriteError( | 92 void SimulateGattDescriptorWriteError( |
93 BluetoothRemoteGattDescriptor* descriptor, | 93 BluetoothRemoteGattDescriptor* descriptor, |
94 BluetoothRemoteGattService::GattErrorCode) override; | 94 BluetoothRemoteGattService::GattErrorCode) override; |
95 void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( | 95 void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( |
96 BluetoothRemoteGattDescriptor* descriptor) override; | 96 BluetoothRemoteGattDescriptor* descriptor) override; |
97 | 97 |
| 98 // Instruct the fake adapter to claim that location services are off for the |
| 99 // device. |
| 100 void SimulateLocationServicesOff(); |
| 101 |
98 // Instruct the fake adapter to throw an IllegalStateException for | 102 // Instruct the fake adapter to throw an IllegalStateException for |
99 // startScan and stopScan. | 103 // startScan and stopScan. |
100 void ForceIllegalStateException(); | 104 void ForceIllegalStateException(); |
101 | 105 |
102 // Records that Java FakeBluetoothDevice connectGatt was called. | 106 // Records that Java FakeBluetoothDevice connectGatt was called. |
103 void OnFakeBluetoothDeviceConnectGattCalled( | 107 void OnFakeBluetoothDeviceConnectGattCalled( |
104 JNIEnv* env, | 108 JNIEnv* env, |
105 const base::android::JavaParamRef<jobject>& caller); | 109 const base::android::JavaParamRef<jobject>& caller); |
106 | 110 |
107 // Records that Java FakeBluetoothGatt disconnect was called. | 111 // Records that Java FakeBluetoothGatt disconnect was called. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 int gatt_open_connections_ = 0; | 162 int gatt_open_connections_ = 0; |
159 BluetoothRemoteGattDescriptor* remembered_ccc_descriptor_ = nullptr; | 163 BluetoothRemoteGattDescriptor* remembered_ccc_descriptor_ = nullptr; |
160 }; | 164 }; |
161 | 165 |
162 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). | 166 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). |
163 typedef BluetoothTestAndroid BluetoothTest; | 167 typedef BluetoothTestAndroid BluetoothTest; |
164 | 168 |
165 } // namespace device | 169 } // namespace device |
166 | 170 |
167 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ | 171 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ |
OLD | NEW |