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_DEVICE_H_
6 #define DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_
10 #include "base/strings/string16.h"
11 #include "device/bluetooth/bluetooth_device.h"
12 #include "device/bluetooth/bluetooth_uuid.h"
13 #include "testing/gmock/include/gmock/gmock.h"
17 class MockBluetoothAdapter
;
19 class MockBluetoothDevice
: public BluetoothDevice
{
21 MockBluetoothDevice(MockBluetoothAdapter
* adapter
,
22 uint32 bluetooth_class
,
23 const std::string
& name
,
24 const std::string
& address
,
27 virtual ~MockBluetoothDevice();
29 MOCK_CONST_METHOD0(GetBluetoothClass
, uint32());
30 MOCK_CONST_METHOD0(GetDeviceName
, std::string());
31 MOCK_CONST_METHOD0(GetAddress
, std::string());
32 MOCK_CONST_METHOD0(GetVendorIDSource
, BluetoothDevice::VendorIDSource());
33 MOCK_CONST_METHOD0(GetVendorID
, uint16());
34 MOCK_CONST_METHOD0(GetProductID
, uint16());
35 MOCK_CONST_METHOD0(GetDeviceID
, uint16());
36 MOCK_CONST_METHOD0(GetName
, base::string16());
37 MOCK_CONST_METHOD0(GetDeviceType
, BluetoothDevice::DeviceType());
38 MOCK_CONST_METHOD0(IsPaired
, bool());
39 MOCK_CONST_METHOD0(IsConnected
, bool());
40 MOCK_CONST_METHOD0(IsConnectable
, bool());
41 MOCK_CONST_METHOD0(IsConnecting
, bool());
42 MOCK_CONST_METHOD0(GetUUIDs
, UUIDList());
43 MOCK_CONST_METHOD0(ExpectingPinCode
, bool());
44 MOCK_CONST_METHOD0(ExpectingPasskey
, bool());
45 MOCK_CONST_METHOD0(ExpectingConfirmation
, bool());
46 MOCK_METHOD1(GetConnectionInfo
, void(const ConnectionInfoCallback
& callback
));
48 void(BluetoothDevice::PairingDelegate
* pairing_delegate
,
49 const base::Closure
& callback
,
50 const BluetoothDevice::ConnectErrorCallback
&
52 MOCK_METHOD1(SetPinCode
, void(const std::string
&));
53 MOCK_METHOD1(SetPasskey
, void(uint32
));
54 MOCK_METHOD0(ConfirmPairing
, void());
55 MOCK_METHOD0(RejectPairing
, void());
56 MOCK_METHOD0(CancelPairing
, void());
57 MOCK_METHOD2(Disconnect
,
58 void(const base::Closure
& callback
,
59 const BluetoothDevice::ErrorCallback
& error_callback
));
60 MOCK_METHOD1(Forget
, void(const BluetoothDevice::ErrorCallback
&));
61 MOCK_METHOD3(ConnectToService
,
62 void(const BluetoothUUID
& uuid
,
63 const ConnectToServiceCallback
& callback
,
64 const ConnectToServiceErrorCallback
& error_callback
));
65 MOCK_METHOD3(ConnectToServiceInsecurely
,
66 void(const BluetoothUUID
& uuid
,
67 const ConnectToServiceCallback
& callback
,
68 const ConnectToServiceErrorCallback
& error_callback
));
69 MOCK_METHOD2(CreateGattConnection
,
70 void(const GattConnectionCallback
& callback
,
71 const ConnectErrorCallback
& error_callback
));
73 MOCK_METHOD2(StartConnectionMonitor
,
74 void(const base::Closure
& callback
,
75 const BluetoothDevice::ErrorCallback
& error_callback
));
77 MOCK_CONST_METHOD0(GetGattServices
, std::vector
<BluetoothGattService
*>());
78 MOCK_CONST_METHOD1(GetGattService
, BluetoothGattService
*(const std::string
&));
81 uint32 bluetooth_class_
;
84 BluetoothDevice::UUIDList uuids_
;
89 #endif // DEVICE_BLUETOOTH_TEST_MOCK_BLUETOOTH_DEVICE_H_