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