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_device.h"
7 #include "base/strings/utf_string_conversions.h"
8 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
12 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter
* adapter
,
13 uint32 bluetooth_class
,
14 const std::string
& name
,
15 const std::string
& address
,
18 : bluetooth_class_(bluetooth_class
),
21 ON_CALL(*this, GetBluetoothClass())
22 .WillByDefault(testing::Return(bluetooth_class_
));
23 ON_CALL(*this, GetDeviceName())
24 .WillByDefault(testing::Return(name_
));
25 ON_CALL(*this, GetAddress())
26 .WillByDefault(testing::Return(address_
));
27 ON_CALL(*this, GetDeviceType())
28 .WillByDefault(testing::Return(DEVICE_UNKNOWN
));
29 ON_CALL(*this, GetVendorIDSource())
30 .WillByDefault(testing::Return(VENDOR_ID_UNKNOWN
));
31 ON_CALL(*this, GetVendorID())
32 .WillByDefault(testing::Return(0));
33 ON_CALL(*this, GetProductID())
34 .WillByDefault(testing::Return(0));
35 ON_CALL(*this, GetDeviceID())
36 .WillByDefault(testing::Return(0));
37 ON_CALL(*this, IsPaired())
38 .WillByDefault(testing::Return(paired
));
39 ON_CALL(*this, IsConnected())
40 .WillByDefault(testing::Return(connected
));
41 ON_CALL(*this, IsConnectable())
42 .WillByDefault(testing::Return(false));
43 ON_CALL(*this, IsConnecting())
44 .WillByDefault(testing::Return(false));
45 ON_CALL(*this, GetName())
46 .WillByDefault(testing::Return(base::UTF8ToUTF16(name_
)));
47 ON_CALL(*this, ExpectingPinCode())
48 .WillByDefault(testing::Return(false));
49 ON_CALL(*this, ExpectingPasskey())
50 .WillByDefault(testing::Return(false));
51 ON_CALL(*this, ExpectingConfirmation())
52 .WillByDefault(testing::Return(false));
53 ON_CALL(*this, GetUUIDs())
54 .WillByDefault(testing::Return(uuids_
));
57 MockBluetoothDevice::~MockBluetoothDevice() {}