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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 ++callback_count_; | 108 ++callback_count_; |
109 notify_sessions_.push_back(notify_session.release()); | 109 notify_sessions_.push_back(notify_session.release()); |
110 | 110 |
111 if (expected == Call::EXPECTED) | 111 if (expected == Call::EXPECTED) |
112 ++actual_success_callback_calls_; | 112 ++actual_success_callback_calls_; |
113 else | 113 else |
114 unexpected_success_callback_ = true; | 114 unexpected_success_callback_ = true; |
115 } | 115 } |
116 | 116 |
117 void BluetoothTestBase::ReadValueCallback(Call expected, | 117 void BluetoothTestBase::ReadValueCallback(Call expected, |
118 const std::vector<uint8>& value) { | 118 const std::vector<uint8_t>& value) { |
119 ++callback_count_; | 119 ++callback_count_; |
120 last_read_value_ = value; | 120 last_read_value_ = value; |
121 | 121 |
122 if (expected == Call::EXPECTED) | 122 if (expected == Call::EXPECTED) |
123 ++actual_success_callback_calls_; | 123 ++actual_success_callback_calls_; |
124 else | 124 else |
125 unexpected_success_callback_ = true; | 125 unexpected_success_callback_ = true; |
126 } | 126 } |
127 | 127 |
128 void BluetoothTestBase::ErrorCallback(Call expected) { | 128 void BluetoothTestBase::ErrorCallback(Call expected) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 error_callback_count_ = 0; | 227 error_callback_count_ = 0; |
228 gatt_connection_attempts_ = 0; | 228 gatt_connection_attempts_ = 0; |
229 gatt_disconnection_attempts_ = 0; | 229 gatt_disconnection_attempts_ = 0; |
230 gatt_discovery_attempts_ = 0; | 230 gatt_discovery_attempts_ = 0; |
231 gatt_notify_characteristic_attempts_ = 0; | 231 gatt_notify_characteristic_attempts_ = 0; |
232 gatt_read_characteristic_attempts_ = 0; | 232 gatt_read_characteristic_attempts_ = 0; |
233 gatt_write_characteristic_attempts_ = 0; | 233 gatt_write_characteristic_attempts_ = 0; |
234 } | 234 } |
235 | 235 |
236 } // namespace device | 236 } // namespace device |
OLD | NEW |