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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 NOTIMPLEMENTED(); | 85 NOTIMPLEMENTED(); |
86 return false; | 86 return false; |
87 } | 87 } |
88 | 88 |
89 std::vector<uint8_t> BluetoothTestBase::LastNotifactionValueForCharacteristic( | 89 std::vector<uint8_t> BluetoothTestBase::LastNotifactionValueForCharacteristic( |
90 BluetoothLocalGattCharacteristic* characteristic) { | 90 BluetoothLocalGattCharacteristic* characteristic) { |
91 NOTIMPLEMENTED(); | 91 NOTIMPLEMENTED(); |
92 return std::vector<uint8_t>(); | 92 return std::vector<uint8_t>(); |
93 } | 93 } |
94 | 94 |
95 void BluetoothTestBase::CheckNotifySessionValue( | |
ortuno
2017/02/20 07:28:02
Great idea! Two suggestiongs:
1. What do you thin
ortuno
2017/02/20 07:32:50
Small correction: This should be {NOTIFY, INDICATE
jlebel
2017/02/21 21:46:30
Done.
| |
96 uint16_t expected_config_descriptor_value, | |
97 int attempts) { | |
98 EXPECT_EQ(attempts, gatt_write_descriptor_attempts_); | |
ortuno
2017/02/20 07:28:02
Could we include gatt_notify_characteristic_attemp
jlebel
2017/02/21 21:46:30
This is mac only. So either I use #define for mac
ortuno
2017/02/22 03:26:21
Actually all platforms use gatt_notify_characteris
jlebel
2017/02/22 12:02:08
Done.
| |
99 ASSERT_EQ(2u, last_write_value_.size()); | |
100 uint8_t expected_byte0 = expected_config_descriptor_value & 0xFF; | |
101 uint8_t expected_byte1 = (expected_config_descriptor_value >> 8) & 0xFF; | |
102 EXPECT_EQ(expected_byte0, last_write_value_[0]); | |
103 EXPECT_EQ(expected_byte1, last_write_value_[1]); | |
104 } | |
105 | |
95 std::vector<BluetoothLocalGattService*> | 106 std::vector<BluetoothLocalGattService*> |
96 BluetoothTestBase::RegisteredGattServices() { | 107 BluetoothTestBase::RegisteredGattServices() { |
97 NOTIMPLEMENTED(); | 108 NOTIMPLEMENTED(); |
98 return std::vector<BluetoothLocalGattService*>(); | 109 return std::vector<BluetoothLocalGattService*>(); |
99 } | 110 } |
100 | 111 |
101 void BluetoothTestBase::DeleteDevice(BluetoothDevice* device) { | 112 void BluetoothTestBase::DeleteDevice(BluetoothDevice* device) { |
102 adapter_->DeleteDeviceForTesting(device->GetAddress()); | 113 adapter_->DeleteDeviceForTesting(device->GetAddress()); |
103 } | 114 } |
104 | 115 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
379 gatt_write_characteristic_attempts_ = 0; | 390 gatt_write_characteristic_attempts_ = 0; |
380 gatt_read_descriptor_attempts_ = 0; | 391 gatt_read_descriptor_attempts_ = 0; |
381 gatt_write_descriptor_attempts_ = 0; | 392 gatt_write_descriptor_attempts_ = 0; |
382 } | 393 } |
383 | 394 |
384 void BluetoothTestBase::RemoveTimedOutDevices() { | 395 void BluetoothTestBase::RemoveTimedOutDevices() { |
385 adapter_->RemoveTimedOutDevices(); | 396 adapter_->RemoveTimedOutDevices(); |
386 } | 397 } |
387 | 398 |
388 } // namespace device | 399 } // namespace device |
OLD | NEW |