| OLD | NEW |
| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // Simulates GattConnection disconnecting. | 84 // Simulates GattConnection disconnecting. |
| 85 virtual void CompleteGattDisconnection(BluetoothDevice* device) {} | 85 virtual void CompleteGattDisconnection(BluetoothDevice* device) {} |
| 86 | 86 |
| 87 // Remove the device from the adapter and delete it. | 87 // Remove the device from the adapter and delete it. |
| 88 virtual void DeleteDevice(BluetoothDevice* device); | 88 virtual void DeleteDevice(BluetoothDevice* device); |
| 89 | 89 |
| 90 // Callbacks that increment |callback_count_|, |error_callback_count_|: | 90 // Callbacks that increment |callback_count_|, |error_callback_count_|: |
| 91 void Callback(); | 91 void Callback(); |
| 92 void DiscoverySessionCallback(scoped_ptr<BluetoothDiscoverySession>); | 92 void DiscoverySessionCallback(scoped_ptr<BluetoothDiscoverySession>); |
| 93 void GattConnectionCallback(scoped_ptr<BluetoothGattConnection>); | 93 void GattConnectionCallback(); |
| 94 void ErrorCallback(); | 94 void ErrorCallback(); |
| 95 void ConnectErrorCallback(enum BluetoothDevice::ConnectErrorCode); | 95 void ConnectErrorCallback(enum BluetoothDevice::ConnectErrorCode); |
| 96 | 96 |
| 97 // Accessors to get callbacks bound to this fixture: | 97 // Accessors to get callbacks bound to this fixture: |
| 98 base::Closure GetCallback(); | 98 base::Closure GetCallback(); |
| 99 BluetoothAdapter::DiscoverySessionCallback GetDiscoverySessionCallback(); | 99 BluetoothAdapter::DiscoverySessionCallback GetDiscoverySessionCallback(); |
| 100 BluetoothDevice::GattConnectionCallback GetGattConnectionCallback(); | 100 BluetoothDevice::GattConnectionCallback GetGattConnectionCallback(); |
| 101 BluetoothAdapter::ErrorCallback GetErrorCallback(); | 101 BluetoothAdapter::ErrorCallback GetErrorCallback(); |
| 102 BluetoothDevice::ConnectErrorCallback GetConnectErrorCallback(); | 102 BluetoothDevice::ConnectErrorCallback GetConnectErrorCallback(); |
| 103 | 103 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 116 int callback_count_ = 0; | 116 int callback_count_ = 0; |
| 117 int error_callback_count_ = 0; | 117 int error_callback_count_ = 0; |
| 118 int gatt_connection_attempt_count_ = 0; | 118 int gatt_connection_attempt_count_ = 0; |
| 119 int gatt_disconnection_attempt_count_ = 0; | 119 int gatt_disconnection_attempt_count_ = 0; |
| 120 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; | 120 base::WeakPtrFactory<BluetoothTestBase> weak_factory_; |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 } // namespace device | 123 } // namespace device |
| 124 | 124 |
| 125 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ | 125 #endif // DEVICE_BLUETOOTH_TEST_BLUETOOTH_TEST_H_ |
| OLD | NEW |