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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 void SimulateGattCharacteristicWriteError( | 64 void SimulateGattCharacteristicWriteError( |
65 BluetoothGattCharacteristic* characteristic, | 65 BluetoothGattCharacteristic* characteristic, |
66 BluetoothGattService::GattErrorCode) override; | 66 BluetoothGattService::GattErrorCode) override; |
67 void SimulateGattCharacteristicWriteWillFailSynchronouslyOnce( | 67 void SimulateGattCharacteristicWriteWillFailSynchronouslyOnce( |
68 BluetoothGattCharacteristic* characteristic) override; | 68 BluetoothGattCharacteristic* characteristic) override; |
69 void SimulateGattDescriptor(BluetoothGattCharacteristic* characteristic, | 69 void SimulateGattDescriptor(BluetoothGattCharacteristic* characteristic, |
70 const std::string& uuid) override; | 70 const std::string& uuid) override; |
71 void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( | 71 void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( |
72 BluetoothGattDescriptor* descriptor) override; | 72 BluetoothGattDescriptor* descriptor) override; |
73 | 73 |
| 74 // Instruct the fake adapter to throw an IllegalStateException for |
| 75 // startScan and stopScan. |
| 76 void ForceIllegalStateException(); |
| 77 |
74 // Records that Java FakeBluetoothDevice connectGatt was called. | 78 // Records that Java FakeBluetoothDevice connectGatt was called. |
75 void OnFakeBluetoothDeviceConnectGattCalled( | 79 void OnFakeBluetoothDeviceConnectGattCalled( |
76 JNIEnv* env, | 80 JNIEnv* env, |
77 const base::android::JavaParamRef<jobject>& caller); | 81 const base::android::JavaParamRef<jobject>& caller); |
78 | 82 |
79 // Records that Java FakeBluetoothGatt disconnect was called. | 83 // Records that Java FakeBluetoothGatt disconnect was called. |
80 void OnFakeBluetoothGattDisconnect( | 84 void OnFakeBluetoothGattDisconnect( |
81 JNIEnv* env, | 85 JNIEnv* env, |
82 const base::android::JavaParamRef<jobject>& caller); | 86 const base::android::JavaParamRef<jobject>& caller); |
83 | 87 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 122 |
119 int gatt_open_connections_ = 0; | 123 int gatt_open_connections_ = 0; |
120 }; | 124 }; |
121 | 125 |
122 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). | 126 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). |
123 typedef BluetoothTestAndroid BluetoothTest; | 127 typedef BluetoothTestAndroid BluetoothTest; |
124 | 128 |
125 } // namespace device | 129 } // namespace device |
126 | 130 |
127 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ | 131 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ |
OLD | NEW |