| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_gatt_service.h" | 5 #include "device/bluetooth/test/mock_bluetooth_gatt_service.h" |
| 6 | 6 |
| 7 #include "device/bluetooth/test/mock_bluetooth_device.h" | 7 #include "device/bluetooth/test/mock_bluetooth_device.h" |
| 8 | 8 |
| 9 using testing::Return; | 9 using testing::Return; |
| 10 using testing::_; | 10 using testing::_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 std::vector<BluetoothGattCharacteristic*> | 41 std::vector<BluetoothGattCharacteristic*> |
| 42 MockBluetoothGattService::GetMockCharacteristics() const { | 42 MockBluetoothGattService::GetMockCharacteristics() const { |
| 43 std::vector<BluetoothGattCharacteristic*> characteristics; | 43 std::vector<BluetoothGattCharacteristic*> characteristics; |
| 44 for (BluetoothGattCharacteristic* characteristic : mock_characteristics_) { | 44 for (BluetoothGattCharacteristic* characteristic : mock_characteristics_) { |
| 45 characteristics.push_back(characteristic); | 45 characteristics.push_back(characteristic); |
| 46 } | 46 } |
| 47 return characteristics; | 47 return characteristics; |
| 48 } | 48 } |
| 49 | 49 |
| 50 BluetoothGattCharacteristic* MockBluetoothGattService::GetMockCharacteristic( |
| 51 const std::string& identifier) const { |
| 52 for (BluetoothGattCharacteristic* characteristic : mock_characteristics_) { |
| 53 if (characteristic->GetIdentifier() == identifier) { |
| 54 return characteristic; |
| 55 } |
| 56 } |
| 57 return nullptr; |
| 58 } |
| 59 |
| 50 } // namespace device | 60 } // namespace device |
| OLD | NEW |