Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Side by Side Diff: device/bluetooth/test/bluetooth_test_android.h

Issue 1610053005: bluetooth: android: Fix a couple of crashes when adapter is turned on/off. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased on latest master Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698