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

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

Issue 1159523002: bluetooth: Browser side partial implementation of getPrimaryService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address scheib's comments Created 5 years, 6 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" 5 #include "device/bluetooth/test/mock_bluetooth_device.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "device/bluetooth/bluetooth_gatt_service.h"
8 #include "device/bluetooth/test/mock_bluetooth_adapter.h" 9 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
9 10
10 namespace device { 11 namespace device {
11 12
12 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter, 13 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter,
13 uint32 bluetooth_class, 14 uint32 bluetooth_class,
14 const std::string& name, 15 const std::string& name,
15 const std::string& address, 16 const std::string& address,
16 bool paired, 17 bool paired,
17 bool connected) 18 bool connected)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ON_CALL(*this, ExpectingPasskey()) 50 ON_CALL(*this, ExpectingPasskey())
50 .WillByDefault(testing::Return(false)); 51 .WillByDefault(testing::Return(false));
51 ON_CALL(*this, ExpectingConfirmation()) 52 ON_CALL(*this, ExpectingConfirmation())
52 .WillByDefault(testing::Return(false)); 53 .WillByDefault(testing::Return(false));
53 ON_CALL(*this, GetUUIDs()) 54 ON_CALL(*this, GetUUIDs())
54 .WillByDefault(testing::Return(uuids_)); 55 .WillByDefault(testing::Return(uuids_));
55 } 56 }
56 57
57 MockBluetoothDevice::~MockBluetoothDevice() {} 58 MockBluetoothDevice::~MockBluetoothDevice() {}
58 59
60 void MockBluetoothDevice::AddMockService(
61 scoped_ptr<MockBluetoothGattService> mock_service) {
62 mock_services_.push_back(mock_service.Pass());
63 }
64
65 std::vector<BluetoothGattService*> MockBluetoothDevice::GetMockServices() {
66 std::vector<BluetoothGattService*> services;
67 for (BluetoothGattService* service : mock_services_) {
68 services.push_back(service);
69 }
70 return services;
71 }
72
59 } // namespace device 73 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698