OLD | NEW |
---|---|
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/bluetooth_gatt_service.h" |
9 #include "device/bluetooth/test/mock_bluetooth_adapter.h" | 9 #include "device/bluetooth/test/mock_bluetooth_adapter.h" |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 | 64 |
65 std::vector<BluetoothGattService*> MockBluetoothDevice::GetMockServices() | 65 std::vector<BluetoothGattService*> MockBluetoothDevice::GetMockServices() |
66 const { | 66 const { |
67 std::vector<BluetoothGattService*> services; | 67 std::vector<BluetoothGattService*> services; |
68 for (BluetoothGattService* service : mock_services_) { | 68 for (BluetoothGattService* service : mock_services_) { |
69 services.push_back(service); | 69 services.push_back(service); |
70 } | 70 } |
71 return services; | 71 return services; |
72 } | 72 } |
73 | 73 |
74 BluetoothGattService* MockBluetoothDevice::GetMockService( | |
75 const std::string& identifier) const { | |
76 for (BluetoothGattService* service : mock_services_) { | |
77 if (service->GetIdentifier() == identifier) { | |
78 return service; | |
79 } | |
armansito
2015/06/09 19:23:49
nit: No need for curly braces here.
ortuno
2015/06/09 20:46:42
Done.
| |
80 } | |
81 return nullptr; | |
82 } | |
83 | |
74 } // namespace device | 84 } // namespace device |
OLD | NEW |