OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/mock_bluetooth_adapter.h" | 5 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
6 | 6 |
7 namespace device { | 7 namespace device { |
8 | 8 |
9 MockBluetoothAdapter::Observer::Observer() {} | 9 MockBluetoothAdapter::Observer::Observer() {} |
10 MockBluetoothAdapter::Observer::~Observer() {} | 10 MockBluetoothAdapter::Observer::~Observer() {} |
(...skipping 28 matching lines...) Expand all Loading... |
39 } | 39 } |
40 | 40 |
41 void MockBluetoothAdapter::StartDiscoverySessionWithFilter( | 41 void MockBluetoothAdapter::StartDiscoverySessionWithFilter( |
42 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, | 42 scoped_ptr<BluetoothDiscoveryFilter> discovery_filter, |
43 const DiscoverySessionCallback& callback, | 43 const DiscoverySessionCallback& callback, |
44 const ErrorCallback& error_callback) { | 44 const ErrorCallback& error_callback) { |
45 StartDiscoverySessionWithFilterRaw(discovery_filter.get(), callback, | 45 StartDiscoverySessionWithFilterRaw(discovery_filter.get(), callback, |
46 error_callback); | 46 error_callback); |
47 } | 47 } |
48 | 48 |
| 49 void MockBluetoothAdapter::AddMockDevice( |
| 50 scoped_ptr<MockBluetoothDevice> mock_device) { |
| 51 mock_devices_.push_back(mock_device.Pass()); |
| 52 } |
| 53 |
| 54 BluetoothAdapter::ConstDeviceList MockBluetoothAdapter::GetConstMockDevices() { |
| 55 BluetoothAdapter::ConstDeviceList devices; |
| 56 for (auto& it : mock_devices_) { |
| 57 devices.push_back(it); |
| 58 } |
| 59 return devices; |
| 60 } |
| 61 |
| 62 BluetoothAdapter::DeviceList MockBluetoothAdapter::GetMockDevices() { |
| 63 BluetoothAdapter::DeviceList devices; |
| 64 for (auto& it : mock_devices_) { |
| 65 devices.push_back(it); |
| 66 } |
| 67 return devices; |
| 68 } |
| 69 |
49 void MockBluetoothAdapter::RegisterAdvertisement( | 70 void MockBluetoothAdapter::RegisterAdvertisement( |
50 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, | 71 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, |
51 const CreateAdvertisementCallback& callback, | 72 const CreateAdvertisementCallback& callback, |
52 const CreateAdvertisementErrorCallback& error_callback) { | 73 const CreateAdvertisementErrorCallback& error_callback) { |
53 } | 74 } |
54 | 75 |
55 } // namespace device | 76 } // namespace device |
OLD | NEW |