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

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

Issue 2499913002: bluetooth: android: Implement RetrieveGattConnectedDevicesWithFilter
Patch Set: rebase Created 4 years 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 13 matching lines...) Expand all
24 void SetUp() override; 24 void SetUp() override;
25 void TearDown() override; 25 void TearDown() override;
26 26
27 // BluetoothTestBase overrides: 27 // BluetoothTestBase overrides:
28 bool PlatformSupportsLowEnergy() override; 28 bool PlatformSupportsLowEnergy() override;
29 void InitWithDefaultAdapter() override; 29 void InitWithDefaultAdapter() override;
30 void InitWithoutDefaultAdapter() override; 30 void InitWithoutDefaultAdapter() override;
31 void InitWithFakeAdapter() override; 31 void InitWithFakeAdapter() override;
32 bool DenyPermission() override; 32 bool DenyPermission() override;
33 BluetoothDevice* SimulateLowEnergyDevice(int device_ordinal) override; 33 BluetoothDevice* SimulateLowEnergyDevice(int device_ordinal) override;
34 void SimulateConnectedLowEnergyDevice(
35 ConnectedDeviceType device_type) override;
34 void RememberDeviceForSubsequentAction(BluetoothDevice* device) override; 36 void RememberDeviceForSubsequentAction(BluetoothDevice* device) override;
35 void SimulateGattConnection(BluetoothDevice* device) override; 37 void SimulateGattConnection(BluetoothDevice* device) override;
36 void SimulateGattConnectionError(BluetoothDevice* device, 38 void SimulateGattConnectionError(BluetoothDevice* device,
37 BluetoothDevice::ConnectErrorCode) override; 39 BluetoothDevice::ConnectErrorCode) override;
38 void SimulateGattDisconnection(BluetoothDevice* device) override; 40 void SimulateGattDisconnection(BluetoothDevice* device) override;
39 void SimulateGattServicesDiscovered( 41 void SimulateGattServicesDiscovered(
40 BluetoothDevice* device, 42 BluetoothDevice* device,
41 const std::vector<std::string>& uuids) override; 43 const std::vector<std::string>& uuids) override;
42 void SimulateGattServicesDiscoveryError(BluetoothDevice* device) override; 44 void SimulateGattServicesDiscoveryError(BluetoothDevice* device) override;
43 void SimulateGattCharacteristic(BluetoothRemoteGattService* service, 45 void SimulateGattCharacteristic(BluetoothRemoteGattService* service,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void OnFakeBluetoothGattReadDescriptor( 152 void OnFakeBluetoothGattReadDescriptor(
151 JNIEnv* env, 153 JNIEnv* env,
152 const base::android::JavaParamRef<jobject>& caller); 154 const base::android::JavaParamRef<jobject>& caller);
153 155
154 // Records that Java FakeBluetoothGatt writeDescriptor was called. 156 // Records that Java FakeBluetoothGatt writeDescriptor was called.
155 void OnFakeBluetoothGattWriteDescriptor( 157 void OnFakeBluetoothGattWriteDescriptor(
156 JNIEnv* env, 158 JNIEnv* env,
157 const base::android::JavaParamRef<jobject>& caller, 159 const base::android::JavaParamRef<jobject>& caller,
158 const base::android::JavaParamRef<jbyteArray>& value); 160 const base::android::JavaParamRef<jbyteArray>& value);
159 161
162 // Records that Java FakeBluetoothManager getConnectedDevices was called.
163 void OnFakeManagerGetConnectedDevices(
164 JNIEnv* env,
165 const base::android::JavaParamRef<jobject>& caller);
166
160 // Records that Java FakeBluetoothAdapter onAdapterStateChanged was called. 167 // Records that Java FakeBluetoothAdapter onAdapterStateChanged was called.
161 void OnFakeAdapterStateChanged( 168 void OnFakeAdapterStateChanged(
162 JNIEnv* env, 169 JNIEnv* env,
163 const base::android::JavaParamRef<jobject>& caller, 170 const base::android::JavaParamRef<jobject>& caller,
164 const bool powered); 171 const bool powered);
165 172
166 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_adapter_; 173 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_adapter_;
174 base::android::ScopedJavaGlobalRef<jobject> j_fake_bluetooth_manager_;
167 175
168 int gatt_open_connections_ = 0; 176 int gatt_open_connections_ = 0;
169 BluetoothRemoteGattDescriptor* remembered_ccc_descriptor_ = nullptr; 177 BluetoothRemoteGattDescriptor* remembered_ccc_descriptor_ = nullptr;
170 }; 178 };
171 179
172 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName). 180 // Defines common test fixture name. Use TEST_F(BluetoothTest, YourTestName).
173 typedef BluetoothTestAndroid BluetoothTest; 181 typedef BluetoothTestAndroid BluetoothTest;
174 182
175 } // namespace device 183 } // namespace device
176 184
177 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_ 185 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_ANDROID_H_
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test.cc ('k') | device/bluetooth/test/bluetooth_test_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698