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

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

Issue 2695573002: Adding BluetoothTestBase::CheckNotifySessionValue() method (Closed)
Patch Set: Should work 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
« no previous file with comments | « device/bluetooth/test/bluetooth_test.h ('k') | device/bluetooth/test/bluetooth_test_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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::ExpectedChangeNotifyValueAttempts(int attempts) {
96 EXPECT_EQ(attempts, gatt_write_descriptor_attempts_);
97 EXPECT_EQ(attempts, gatt_notify_characteristic_attempts_);
98 }
99
100 void BluetoothTestBase::ExpectedNotifyValue(
101 NotifyValueState expected_value_state) {
102 ASSERT_EQ(2u, last_write_value_.size());
103 switch (expected_value_state) {
104 case NotifyValueState::NONE:
105 EXPECT_EQ(0, last_write_value_[0]);
106 EXPECT_EQ(0, last_write_value_[1]);
107 break;
108 case NotifyValueState::NOTIFY:
109 EXPECT_EQ(1, last_write_value_[0]);
110 EXPECT_EQ(0, last_write_value_[1]);
111 break;
112 case NotifyValueState::INDICATE:
113 EXPECT_EQ(2, last_write_value_[0]);
114 EXPECT_EQ(0, last_write_value_[1]);
115 break;
116 }
117 }
118
95 std::vector<BluetoothLocalGattService*> 119 std::vector<BluetoothLocalGattService*>
96 BluetoothTestBase::RegisteredGattServices() { 120 BluetoothTestBase::RegisteredGattServices() {
97 NOTIMPLEMENTED(); 121 NOTIMPLEMENTED();
98 return std::vector<BluetoothLocalGattService*>(); 122 return std::vector<BluetoothLocalGattService*>();
99 } 123 }
100 124
101 void BluetoothTestBase::DeleteDevice(BluetoothDevice* device) { 125 void BluetoothTestBase::DeleteDevice(BluetoothDevice* device) {
102 adapter_->DeleteDeviceForTesting(device->GetAddress()); 126 adapter_->DeleteDeviceForTesting(device->GetAddress());
103 } 127 }
104 128
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 gatt_write_characteristic_attempts_ = 0; 403 gatt_write_characteristic_attempts_ = 0;
380 gatt_read_descriptor_attempts_ = 0; 404 gatt_read_descriptor_attempts_ = 0;
381 gatt_write_descriptor_attempts_ = 0; 405 gatt_write_descriptor_attempts_ = 0;
382 } 406 }
383 407
384 void BluetoothTestBase::RemoveTimedOutDevices() { 408 void BluetoothTestBase::RemoveTimedOutDevices() {
385 adapter_->RemoveTimedOutDevices(); 409 adapter_->RemoveTimedOutDevices();
386 } 410 }
387 411
388 } // namespace device 412 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/test/bluetooth_test.h ('k') | device/bluetooth/test/bluetooth_test_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698