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 #ifndef DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_
10 #include "base/callback.h"
11 #include "device/bluetooth/bluetooth_adapter.h"
12 #include "device/bluetooth/bluetooth_device.h"
13 #include "testing/gmock/include/gmock/gmock.h"
17 class MockBluetoothAdapter : public BluetoothAdapter {
19 class Observer : public BluetoothAdapter::Observer {
24 MOCK_METHOD2(AdapterPresentChanged, void(BluetoothAdapter*, bool));
25 MOCK_METHOD2(AdapterPoweredChanged, void(BluetoothAdapter*, bool));
26 MOCK_METHOD2(AdapterDiscoveringChanged, void(BluetoothAdapter*, bool));
27 MOCK_METHOD2(DeviceAdded, void(BluetoothAdapter*, BluetoothDevice*));
28 MOCK_METHOD2(DeviceChanged, void(BluetoothAdapter*, BluetoothDevice*));
29 MOCK_METHOD2(DeviceRemoved, void(BluetoothAdapter*, BluetoothDevice*));
32 MockBluetoothAdapter();
34 MOCK_METHOD1(AddObserver, void(BluetoothAdapter::Observer*));
35 MOCK_METHOD1(RemoveObserver, void(BluetoothAdapter::Observer*));
36 MOCK_CONST_METHOD0(GetAddress, std::string());
37 MOCK_CONST_METHOD0(GetName, std::string());
39 void(const std::string& name,
40 const base::Closure& callback,
41 const ErrorCallback& error_callback));
42 MOCK_CONST_METHOD0(IsInitialized, bool());
43 MOCK_CONST_METHOD0(IsPresent, bool());
44 MOCK_CONST_METHOD0(IsPowered, bool());
45 MOCK_METHOD3(SetPowered,
47 const base::Closure& callback,
48 const ErrorCallback& error_callback));
49 MOCK_CONST_METHOD0(IsDiscoverable, bool());
50 MOCK_METHOD3(SetDiscoverable,
51 void(bool discoverable,
52 const base::Closure& callback,
53 const ErrorCallback& error_callback));
54 MOCK_CONST_METHOD0(IsDiscovering, bool());
55 MOCK_METHOD2(StartDiscovering,
56 void(const base::Closure& callback,
57 const ErrorCallback& error_callback));
58 MOCK_METHOD2(StopDiscovering,
59 void(const base::Closure& callback,
60 const ErrorCallback& error_callback));
61 MOCK_CONST_METHOD0(GetDevices, BluetoothAdapter::ConstDeviceList());
62 MOCK_METHOD1(GetDevice, BluetoothDevice*(const std::string& address));
63 MOCK_CONST_METHOD1(GetDevice,
64 const BluetoothDevice*(const std::string& address));
66 ReadLocalOutOfBandPairingData,
67 void(const BluetoothOutOfBandPairingDataCallback& callback,
68 const ErrorCallback& error_callback));
70 virtual ~MockBluetoothAdapter();
75 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_ADAPTER_H_