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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::RegisterAdvertisement( | 49 void MockBluetoothAdapter::RegisterAdvertisement( |
50 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, | 50 scoped_ptr<BluetoothAdvertisement::Data> advertisement_data, |
51 const CreateAdvertisementCallback& callback, | 51 const CreateAdvertisementCallback& callback, |
52 const CreateAdvertisementErrorCallback& error_callback) { | 52 const CreateAdvertisementErrorCallback& error_callback) { |
53 } | 53 } |
54 | 54 |
| 55 void MockBluetoothAdapter::SetMockDevices( |
| 56 std::vector<MockBluetoothDevice*> mock_devices) { |
| 57 mock_devices_.clear(); |
| 58 for (std::vector<MockBluetoothDevice*>::iterator it = mock_devices.begin(); |
| 59 it != mock_devices.end(); ++it) { |
| 60 mock_devices_.push_back(*it); |
| 61 } |
| 62 } |
| 63 |
| 64 BluetoothAdapter::ConstDeviceList MockBluetoothAdapter::GetMockDevices() { |
| 65 BluetoothAdapter::ConstDeviceList devices; |
| 66 for (ScopedVector<MockBluetoothDevice>::iterator it = mock_devices_.begin(); |
| 67 it != mock_devices_.end(); ++it) { |
| 68 devices.push_back(*it); |
| 69 } |
| 70 return devices; |
| 71 } |
| 72 |
55 } // namespace device | 73 } // namespace device |
OLD | NEW |