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

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

Issue 1804093003: Add BluetoothGattCharacteristicTest::StartNotifySession_Reentrant unit test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_H_ 5 #ifndef DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 6 #define DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 void GattConnectionCallback(Call expected, 264 void GattConnectionCallback(Call expected,
265 std::unique_ptr<BluetoothGattConnection>); 265 std::unique_ptr<BluetoothGattConnection>);
266 void NotifyCallback(Call expected, 266 void NotifyCallback(Call expected,
267 std::unique_ptr<BluetoothGattNotifySession>); 267 std::unique_ptr<BluetoothGattNotifySession>);
268 void ReadValueCallback(Call expected, const std::vector<uint8_t>& value); 268 void ReadValueCallback(Call expected, const std::vector<uint8_t>& value);
269 void ErrorCallback(Call expected); 269 void ErrorCallback(Call expected);
270 void ConnectErrorCallback(Call expected, 270 void ConnectErrorCallback(Call expected,
271 enum BluetoothDevice::ConnectErrorCode); 271 enum BluetoothDevice::ConnectErrorCode);
272 void GattErrorCallback(Call expected, 272 void GattErrorCallback(Call expected,
273 BluetoothRemoteGattService::GattErrorCode); 273 BluetoothRemoteGattService::GattErrorCode);
274 void ReentrantStartNotifySessionSuccessCallback(
275 Call expected,
276 BluetoothRemoteGattCharacteristic* characteristic,
277 std::unique_ptr<BluetoothGattNotifySession> notify_session);
278 void ReentrantStartNotifySessionErrorCallback(
279 Call expected,
280 BluetoothRemoteGattCharacteristic* characteristic,
281 bool error_in_reentrant,
282 BluetoothGattService::GattErrorCode error_code);
274 283
275 // Accessors to get callbacks bound to this fixture: 284 // Accessors to get callbacks bound to this fixture:
276 base::Closure GetCallback(Call expected); 285 base::Closure GetCallback(Call expected);
277 BluetoothAdapter::DiscoverySessionCallback GetDiscoverySessionCallback( 286 BluetoothAdapter::DiscoverySessionCallback GetDiscoverySessionCallback(
278 Call expected); 287 Call expected);
279 BluetoothDevice::GattConnectionCallback GetGattConnectionCallback( 288 BluetoothDevice::GattConnectionCallback GetGattConnectionCallback(
280 Call expected); 289 Call expected);
281 BluetoothRemoteGattCharacteristic::NotifySessionCallback GetNotifyCallback( 290 BluetoothRemoteGattCharacteristic::NotifySessionCallback GetNotifyCallback(
282 Call expected); 291 Call expected);
283 BluetoothRemoteGattCharacteristic::ValueCallback GetReadValueCallback( 292 BluetoothRemoteGattCharacteristic::ValueCallback GetReadValueCallback(
284 Call expected); 293 Call expected);
285 BluetoothAdapter::ErrorCallback GetErrorCallback(Call expected); 294 BluetoothAdapter::ErrorCallback GetErrorCallback(Call expected);
286 BluetoothDevice::ConnectErrorCallback GetConnectErrorCallback(Call expected); 295 BluetoothDevice::ConnectErrorCallback GetConnectErrorCallback(Call expected);
287 base::Callback<void(BluetoothRemoteGattService::GattErrorCode)> 296 base::Callback<void(BluetoothRemoteGattService::GattErrorCode)>
288 GetGattErrorCallback(Call expected); 297 GetGattErrorCallback(Call expected);
298 BluetoothRemoteGattCharacteristic::NotifySessionCallback
299 GetReentrantStartNotifySessionSuccessCallback(
300 Call expected,
301 BluetoothRemoteGattCharacteristic* characteristic);
302 base::Callback<void(BluetoothGattService::GattErrorCode)>
303 GetReentrantStartNotifySessionErrorCallback(
304 Call expected,
305 BluetoothRemoteGattCharacteristic* characteristic,
306 bool error_in_reentrant);
289 307
290 // Reset all event count members to 0. 308 // Reset all event count members to 0.
291 void ResetEventCounts(); 309 void ResetEventCounts();
292 310
293 // A Message loop is required by some implementations that will PostTasks and 311 // A Message loop is required by some implementations that will PostTasks and
294 // by base::RunLoop().RunUntilIdle() use in this fixture. 312 // by base::RunLoop().RunUntilIdle() use in this fixture.
295 base::MessageLoop message_loop_; 313 base::MessageLoop message_loop_;
296 314
297 scoped_refptr<BluetoothAdapter> adapter_; 315 scoped_refptr<BluetoothAdapter> adapter_;
298 ScopedVector<BluetoothDiscoverySession> discovery_sessions_; 316 ScopedVector<BluetoothDiscoverySession> discovery_sessions_;
(...skipping 24 matching lines...) Expand all
323 int actual_error_callback_calls_ = 0; 341 int actual_error_callback_calls_ = 0;
324 bool unexpected_success_callback_ = false; 342 bool unexpected_success_callback_ = false;
325 bool unexpected_error_callback_ = false; 343 bool unexpected_error_callback_ = false;
326 344
327 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; 345 base::WeakPtrFactory<BluetoothTestBase> weak_factory_;
328 }; 346 };
329 347
330 } // namespace device 348 } // namespace device
331 349
332 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 350 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc ('k') | device/bluetooth/test/bluetooth_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698