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 #include "device/bluetooth/test/bluetooth_test.h" | 5 #include "device/bluetooth/test/bluetooth_test.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "device/bluetooth/bluetooth_adapter.h" | 10 #include "device/bluetooth/bluetooth_adapter.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void BluetoothTestBase::Callback() { | 49 void BluetoothTestBase::Callback() { |
50 ++callback_count_; | 50 ++callback_count_; |
51 } | 51 } |
52 | 52 |
53 void BluetoothTestBase::DiscoverySessionCallback( | 53 void BluetoothTestBase::DiscoverySessionCallback( |
54 scoped_ptr<BluetoothDiscoverySession> discovery_session) { | 54 scoped_ptr<BluetoothDiscoverySession> discovery_session) { |
55 ++callback_count_; | 55 ++callback_count_; |
56 discovery_sessions_.push_back(discovery_session.release()); | 56 discovery_sessions_.push_back(discovery_session.release()); |
57 } | 57 } |
58 | 58 |
59 void BluetoothTestBase::GattConnectionCallback( | 59 void BluetoothTestBase::GattConnectionCallback() { |
60 scoped_ptr<BluetoothGattConnection> connection) { | |
61 ++callback_count_; | 60 ++callback_count_; |
62 gatt_connections_.push_back(connection.release()); | |
63 } | 61 } |
64 | 62 |
65 void BluetoothTestBase::ErrorCallback() { | 63 void BluetoothTestBase::ErrorCallback() { |
66 ++error_callback_count_; | 64 ++error_callback_count_; |
67 } | 65 } |
68 | 66 |
69 void BluetoothTestBase::ConnectErrorCallback( | 67 void BluetoothTestBase::ConnectErrorCallback( |
70 enum BluetoothDevice::ConnectErrorCode error_code) { | 68 enum BluetoothDevice::ConnectErrorCode error_code) { |
71 ++error_callback_count_; | 69 ++error_callback_count_; |
72 last_connect_error_code_ = error_code; | 70 last_connect_error_code_ = error_code; |
(...skipping 28 matching lines...) Expand all Loading... |
101 | 99 |
102 void BluetoothTestBase::ResetEventCounts() { | 100 void BluetoothTestBase::ResetEventCounts() { |
103 last_connect_error_code_ = BluetoothDevice::ERROR_UNKNOWN; | 101 last_connect_error_code_ = BluetoothDevice::ERROR_UNKNOWN; |
104 callback_count_ = 0; | 102 callback_count_ = 0; |
105 error_callback_count_ = 0; | 103 error_callback_count_ = 0; |
106 gatt_connection_attempt_count_ = 0; | 104 gatt_connection_attempt_count_ = 0; |
107 gatt_disconnection_attempt_count_ = 0; | 105 gatt_disconnection_attempt_count_ = 0; |
108 } | 106 } |
109 | 107 |
110 } // namespace device | 108 } // namespace device |
OLD | NEW |