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

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

Issue 1898643002: Refactor device::BluetoothGattXXX classes to split into remote/local. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "device/bluetooth/bluetooth_gatt_service.h" 11 #include "device/bluetooth/bluetooth_remote_gatt_service.h"
12 #include "device/bluetooth/test/mock_bluetooth_adapter.h" 12 #include "device/bluetooth/test/mock_bluetooth_adapter.h"
13 13
14 namespace device { 14 namespace device {
15 15
16 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter, 16 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter,
17 uint32_t bluetooth_class, 17 uint32_t bluetooth_class,
18 const std::string& name, 18 const std::string& name,
19 const std::string& address, 19 const std::string& address,
20 bool paired, 20 bool paired,
21 bool connected) 21 bool connected)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 .WillByDefault(testing::Return(uuids_)); 61 .WillByDefault(testing::Return(uuids_));
62 } 62 }
63 63
64 MockBluetoothDevice::~MockBluetoothDevice() {} 64 MockBluetoothDevice::~MockBluetoothDevice() {}
65 65
66 void MockBluetoothDevice::AddMockService( 66 void MockBluetoothDevice::AddMockService(
67 std::unique_ptr<MockBluetoothGattService> mock_service) { 67 std::unique_ptr<MockBluetoothGattService> mock_service) {
68 mock_services_.push_back(std::move(mock_service)); 68 mock_services_.push_back(std::move(mock_service));
69 } 69 }
70 70
71 std::vector<BluetoothGattService*> MockBluetoothDevice::GetMockServices() 71 std::vector<BluetoothRemoteGattService*> MockBluetoothDevice::GetMockServices()
72 const { 72 const {
73 std::vector<BluetoothGattService*> services; 73 std::vector<BluetoothRemoteGattService*> services;
74 for (BluetoothGattService* service : mock_services_) { 74 for (BluetoothRemoteGattService* service : mock_services_) {
75 services.push_back(service); 75 services.push_back(service);
76 } 76 }
77 return services; 77 return services;
78 } 78 }
79 79
80 BluetoothGattService* MockBluetoothDevice::GetMockService( 80 BluetoothRemoteGattService* MockBluetoothDevice::GetMockService(
81 const std::string& identifier) const { 81 const std::string& identifier) const {
82 for (BluetoothGattService* service : mock_services_) { 82 for (BluetoothRemoteGattService* service : mock_services_) {
83 if (service->GetIdentifier() == identifier) 83 if (service->GetIdentifier() == identifier)
84 return service; 84 return service;
85 } 85 }
86 return nullptr; 86 return nullptr;
87 } 87 }
88 88
89 } // namespace device 89 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_device.h ('k') | device/bluetooth/test/mock_bluetooth_gatt_characteristic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698