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

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

Issue 2695573002: Adding BluetoothTestBase::CheckNotifySessionValue() method (Closed)
Patch Set: Fixing tests Created 3 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_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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 // Simulates a Descriptor Write operation failing with a GattErrorCode. 394 // Simulates a Descriptor Write operation failing with a GattErrorCode.
395 virtual void SimulateGattDescriptorWriteError( 395 virtual void SimulateGattDescriptorWriteError(
396 BluetoothRemoteGattDescriptor* descriptor, 396 BluetoothRemoteGattDescriptor* descriptor,
397 BluetoothRemoteGattService::GattErrorCode) {} 397 BluetoothRemoteGattService::GattErrorCode) {}
398 398
399 // Simulates a Descriptor Write operation failing synchronously once for 399 // Simulates a Descriptor Write operation failing synchronously once for
400 // an unknown reason. 400 // an unknown reason.
401 virtual void SimulateGattDescriptorWriteWillFailSynchronouslyOnce( 401 virtual void SimulateGattDescriptorWriteWillFailSynchronouslyOnce(
402 BluetoothRemoteGattDescriptor* descriptor) {} 402 BluetoothRemoteGattDescriptor* descriptor) {}
403 403
404 // Tests if the notify session has been changed. The default implementation
405 // uses descriptors.
406 virtual void CheckNotifySessionValue(
407 uint16_t expected_config_descriptor_value,
408 int attempts);
409
404 // Returns a list of local GATT services registered with the adapter. 410 // Returns a list of local GATT services registered with the adapter.
405 virtual std::vector<BluetoothLocalGattService*> RegisteredGattServices(); 411 virtual std::vector<BluetoothLocalGattService*> RegisteredGattServices();
406 412
407 // Removes the device from the adapter and deletes it. 413 // Removes the device from the adapter and deletes it.
408 virtual void DeleteDevice(BluetoothDevice* device); 414 virtual void DeleteDevice(BluetoothDevice* device);
409 415
410 // Callbacks that increment |callback_count_|, |error_callback_count_|: 416 // Callbacks that increment |callback_count_|, |error_callback_count_|:
411 void Callback(Call expected); 417 void Callback(Call expected);
412 void DiscoverySessionCallback(Call expected, 418 void DiscoverySessionCallback(Call expected,
413 std::unique_ptr<BluetoothDiscoverySession>); 419 std::unique_ptr<BluetoothDiscoverySession>);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 int actual_error_callback_calls_ = 0; 508 int actual_error_callback_calls_ = 0;
503 bool unexpected_success_callback_ = false; 509 bool unexpected_success_callback_ = false;
504 bool unexpected_error_callback_ = false; 510 bool unexpected_error_callback_ = false;
505 511
506 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; 512 base::WeakPtrFactory<BluetoothTestBase> weak_factory_;
507 }; 513 };
508 514
509 } // namespace device 515 } // namespace device
510 516
511 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ 517 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698