Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: device/bluetooth/test/mock_bluetooth_device.cc

Issue 12929003: Implemented BluetoothAdapterMac::AddDevices(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DeviceRemoved obsolete in OSX. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_device.h"
6
5 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "device/bluetooth/bluetooth_device.h"
6 #include "device/bluetooth/test/mock_bluetooth_adapter.h" 9 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
7 #include "device/bluetooth/test/mock_bluetooth_device.h"
8 10
9 namespace device { 11 namespace device {
10 12
11 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter, 13 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter,
12 const std::string& name, 14 const std::string& name,
13 const std::string& address, 15 const std::string& address,
14 bool paired, 16 bool paired,
15 bool bonded, 17 bool bonded,
16 bool connected) 18 bool connected)
17 : name_(UTF8ToUTF16(name)), 19 : BluetoothDevice(name, address, 0, connected, bonded),
20 name_(UTF8ToUTF16(name)),
18 address_(address) { 21 address_(address) {
19 ON_CALL(*this, GetName()) 22 ON_CALL(*this, GetName())
20 .WillByDefault(testing::Return(name_)); 23 .WillByDefault(testing::Return(name_));
21 ON_CALL(*this, address()) 24 ON_CALL(*this, address())
22 .WillByDefault(testing::ReturnRef(address_)); 25 .WillByDefault(testing::ReturnRef(address_));
23 ON_CALL(*this, IsPaired()) 26 ON_CALL(*this, IsPaired())
24 .WillByDefault(testing::Return(paired)); 27 .WillByDefault(testing::Return(paired));
25 ON_CALL(*this, IsBonded()) 28 ON_CALL(*this, IsBonded())
26 .WillByDefault(testing::Return(bonded)); 29 .WillByDefault(testing::Return(bonded));
27 ON_CALL(*this, IsConnected()) 30 ON_CALL(*this, IsConnected())
28 .WillByDefault(testing::Return(connected)); 31 .WillByDefault(testing::Return(connected));
29 ON_CALL(*this, ExpectingPinCode()) 32 ON_CALL(*this, ExpectingPinCode())
30 .WillByDefault(testing::Return(false)); 33 .WillByDefault(testing::Return(false));
31 ON_CALL(*this, ExpectingPasskey()) 34 ON_CALL(*this, ExpectingPasskey())
32 .WillByDefault(testing::Return(false)); 35 .WillByDefault(testing::Return(false));
33 ON_CALL(*this, ExpectingConfirmation()) 36 ON_CALL(*this, ExpectingConfirmation())
34 .WillByDefault(testing::Return(false)); 37 .WillByDefault(testing::Return(false));
35 ON_CALL(*this, GetServices()) 38 ON_CALL(*this, GetServices())
36 .WillByDefault(testing::ReturnRef(service_list_)); 39 .WillByDefault(testing::ReturnRef(service_list_));
37 } 40 }
38 41
39 MockBluetoothDevice::~MockBluetoothDevice() {} 42 MockBluetoothDevice::~MockBluetoothDevice() {}
40 43
41 } // namespace device 44 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698