 Chromium Code Reviews
 Chromium Code Reviews Issue 2908673002:
  device/blueooth: Add BlueZ unit test for BluetoothDevice::SetConnectionInterval.  (Closed)
    
  
    Issue 2908673002:
  device/blueooth: Add BlueZ unit test for BluetoothDevice::SetConnectionInterval.  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/dbus/fake_bluetooth_device_client.h" | 5 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h" | 
| 6 | 6 | 
| 7 #include <fcntl.h> | 7 #include <fcntl.h> | 
| 8 #include <stddef.h> | 8 #include <stddef.h> | 
| 9 #include <sys/socket.h> | 9 #include <sys/socket.h> | 
| 10 #include <sys/types.h> | 10 #include <sys/types.h> | 
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 | 594 | 
| 595 callback.Run(connection_rssi_, transmit_power_, max_transmit_power_); | 595 callback.Run(connection_rssi_, transmit_power_, max_transmit_power_); | 
| 596 } | 596 } | 
| 597 | 597 | 
| 598 void FakeBluetoothDeviceClient::SetLEConnectionParameters( | 598 void FakeBluetoothDeviceClient::SetLEConnectionParameters( | 
| 599 const dbus::ObjectPath& object_path, | 599 const dbus::ObjectPath& object_path, | 
| 600 const ConnectionParameters& conn_params, | 600 const ConnectionParameters& conn_params, | 
| 601 const base::Closure& callback, | 601 const base::Closure& callback, | 
| 602 const ErrorCallback& error_callback) { | 602 const ErrorCallback& error_callback) { | 
| 603 Properties* properties = GetProperties(object_path); | 603 Properties* properties = GetProperties(object_path); | 
| 604 if (!properties->connected.value()) { | 604 if (!properties->type.is_valid() || properties->type.value() == kTypeBredr) { | 
| 
ortuno
2017/06/01 22:59:35
nit: Add test for invalid type
 
Tim Song
2017/06/01 23:45:31
Done.
 | |
| 605 error_callback.Run(bluetooth_device::kErrorNotConnected, "Not Connected"); | 605 error_callback.Run(bluetooth_device::kErrorFailed, | 
| 606 "BR/EDR devices not supported"); | |
| 606 return; | 607 return; | 
| 607 } | 608 } | 
| 608 | 609 | 
| 609 callback.Run(); | 610 callback.Run(); | 
| 610 } | 611 } | 
| 611 | 612 | 
| 612 void FakeBluetoothDeviceClient::GetServiceRecords( | 613 void FakeBluetoothDeviceClient::GetServiceRecords( | 
| 613 const dbus::ObjectPath& object_path, | 614 const dbus::ObjectPath& object_path, | 
| 614 const ServiceRecordsCallback& callback, | 615 const ServiceRecordsCallback& callback, | 
| 615 const ErrorCallback& error_callback) { | 616 const ErrorCallback& error_callback) { | 
| (...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1859 properties->service_data.set_valid(true); | 1860 properties->service_data.set_valid(true); | 
| 1860 } | 1861 } | 
| 1861 | 1862 | 
| 1862 properties_map_.insert(std::make_pair(device_path, std::move(properties))); | 1863 properties_map_.insert(std::make_pair(device_path, std::move(properties))); | 
| 1863 device_list_.push_back(device_path); | 1864 device_list_.push_back(device_path); | 
| 1864 for (auto& observer : observers_) | 1865 for (auto& observer : observers_) | 
| 1865 observer.DeviceAdded(device_path); | 1866 observer.DeviceAdded(device_path); | 
| 1866 } | 1867 } | 
| 1867 | 1868 | 
| 1868 } // namespace bluez | 1869 } // namespace bluez | 
| OLD | NEW |