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

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

Issue 1779083002: bluetooth: Test & make StartNotifySession reentrant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bta-notify-followup-descriptors-
Patch Set: addressed ortuno comments Created 4 years, 9 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
« no previous file with comments | « device/bluetooth/test/bluetooth_test.h ('k') | device/bluetooth/test/bluetooth_test_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26 matching lines...) Expand all
37 void SimulateGattDisconnection(BluetoothDevice* device) override; 37 void SimulateGattDisconnection(BluetoothDevice* device) override;
38 void SimulateGattServicesDiscovered( 38 void SimulateGattServicesDiscovered(
39 BluetoothDevice* device, 39 BluetoothDevice* device,
40 const std::vector<std::string>& uuids) override; 40 const std::vector<std::string>& uuids) override;
41 void SimulateGattServicesDiscoveryError(BluetoothDevice* device) override; 41 void SimulateGattServicesDiscoveryError(BluetoothDevice* device) override;
42 void SimulateGattCharacteristic(BluetoothGattService* service, 42 void SimulateGattCharacteristic(BluetoothGattService* service,
43 const std::string& uuid, 43 const std::string& uuid,
44 int properties) override; 44 int properties) override;
45 void RememberCharacteristicForSubsequentAction( 45 void RememberCharacteristicForSubsequentAction(
46 BluetoothGattCharacteristic* characteristic) override; 46 BluetoothGattCharacteristic* characteristic) override;
47 void RememberCCCDescriptorForSubsequentAction(
48 BluetoothGattCharacteristic* characteristic) override;
47 void SimulateGattNotifySessionStarted( 49 void SimulateGattNotifySessionStarted(
48 BluetoothGattCharacteristic* characteristic) override; 50 BluetoothGattCharacteristic* characteristic) override;
51 void SimulateGattNotifySessionStartError(
52 BluetoothGattCharacteristic* characteristic,
53 BluetoothGattService::GattErrorCode error_code) override;
49 void SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce( 54 void SimulateGattCharacteristicSetNotifyWillFailSynchronouslyOnce(
50 BluetoothGattCharacteristic* characteristic) override; 55 BluetoothGattCharacteristic* characteristic) override;
51 void SimulateGattCharacteristicChanged( 56 void SimulateGattCharacteristicChanged(
52 BluetoothGattCharacteristic* characteristic, 57 BluetoothGattCharacteristic* characteristic,
53 const std::vector<uint8_t>& value) override; 58 const std::vector<uint8_t>& value) override;
54 59
55 void SimulateGattCharacteristicRead( 60 void SimulateGattCharacteristicRead(
56 BluetoothGattCharacteristic* characteristic, 61 BluetoothGattCharacteristic* characteristic,
57 const std::vector<uint8_t>& value) override; 62 const std::vector<uint8_t>& value) override;
58 void SimulateGattCharacteristicReadError( 63 void SimulateGattCharacteristicReadError(
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 149
145 // Records that Java FakeBluetoothAdapter onAdapterStateChanged was called. 150 // Records that Java FakeBluetoothAdapter onAdapterStateChanged was called.
146 void OnFakeAdapterStateChanged( 151 void OnFakeAdapterStateChanged(
147 JNIEnv* env, 152 JNIEnv* env,
148 const base::android::JavaParamRef<jobject>& caller, 153 const base::android::JavaParamRef<jobject>& caller,
149 const bool powered); 154 const bool powered);
150 155
151 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_adapter_; 156 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_adapter_;
152 157
153 int gatt_open_connections_ = 0; 158 int gatt_open_connections_ = 0;
159 BluetoothGattDescriptor* remembered_ccc_descriptor_ = nullptr;
154 }; 160 };
155 161
156 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). 162 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName).
157 typedef BluetoothTestAndroid BluetoothTest; 163 typedef BluetoothTestAndroid BluetoothTest;
158 164
159 } // namespace device 165 } // namespace device
160 166
161 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ 167 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test.h ('k') | device/bluetooth/test/bluetooth_test_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698