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
3 // found in the LICENSE file.
5 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
7 #include "device/bluetooth/test/mock_bluetooth_advertisement.h"
11 MockBluetoothAdapter::Observer::Observer() {}
12 MockBluetoothAdapter::Observer::~Observer() {}
14 MockBluetoothAdapter::MockBluetoothAdapter() {
17 MockBluetoothAdapter::~MockBluetoothAdapter() {}
19 #if defined(OS_CHROMEOS)
20 void MockBluetoothAdapter::Shutdown() {
24 void MockBluetoothAdapter::AddDiscoverySession(
25 BluetoothDiscoveryFilter
* discovery_filter
,
26 const base::Closure
& callback
,
27 const DiscoverySessionErrorCallback
& error_callback
) {}
29 void MockBluetoothAdapter::RemoveDiscoverySession(
30 BluetoothDiscoveryFilter
* discovery_filter
,
31 const base::Closure
& callback
,
32 const DiscoverySessionErrorCallback
& error_callback
) {}
34 void MockBluetoothAdapter::SetDiscoveryFilter(
35 scoped_ptr
<BluetoothDiscoveryFilter
> discovery_filter
,
36 const base::Closure
& callback
,
37 const DiscoverySessionErrorCallback
& error_callback
) {
38 SetDiscoveryFilterRaw(discovery_filter
.get(), callback
, error_callback
);
41 void MockBluetoothAdapter::StartDiscoverySessionWithFilter(
42 scoped_ptr
<BluetoothDiscoveryFilter
> discovery_filter
,
43 const DiscoverySessionCallback
& callback
,
44 const ErrorCallback
& error_callback
) {
45 StartDiscoverySessionWithFilterRaw(discovery_filter
.get(), callback
,
49 void MockBluetoothAdapter::AddMockDevice(
50 scoped_ptr
<MockBluetoothDevice
> mock_device
) {
51 mock_devices_
.push_back(mock_device
.Pass());
54 BluetoothAdapter::ConstDeviceList
MockBluetoothAdapter::GetConstMockDevices() {
55 BluetoothAdapter::ConstDeviceList devices
;
56 for (auto& it
: mock_devices_
) {
57 devices
.push_back(it
);
62 BluetoothAdapter::DeviceList
MockBluetoothAdapter::GetMockDevices() {
63 BluetoothAdapter::DeviceList devices
;
64 for (auto& it
: mock_devices_
) {
65 devices
.push_back(it
);
70 void MockBluetoothAdapter::RegisterAdvertisement(
71 scoped_ptr
<BluetoothAdvertisement::Data
> advertisement_data
,
72 const CreateAdvertisementCallback
& callback
,
73 const CreateAdvertisementErrorCallback
& error_callback
) {
74 callback
.Run(new MockBluetoothAdvertisement
);