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 |
11 namespace device { | 11 namespace device { |
12 | 12 |
13 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter, | 13 MockBluetoothDevice::MockBluetoothDevice(MockBluetoothAdapter* adapter, |
14 uint32 bluetooth_class, | 14 uint32_t bluetooth_class, |
15 const std::string& name, | 15 const std::string& name, |
16 const std::string& address, | 16 const std::string& address, |
17 bool paired, | 17 bool paired, |
18 bool connected) | 18 bool connected) |
19 : BluetoothDevice(adapter), | 19 : BluetoothDevice(adapter), |
20 bluetooth_class_(bluetooth_class), | 20 bluetooth_class_(bluetooth_class), |
21 name_(name), | 21 name_(name), |
22 address_(address) { | 22 address_(address) { |
23 ON_CALL(*this, GetBluetoothClass()) | 23 ON_CALL(*this, GetBluetoothClass()) |
24 .WillByDefault(testing::Return(bluetooth_class_)); | 24 .WillByDefault(testing::Return(bluetooth_class_)); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 BluetoothGattService* MockBluetoothDevice::GetMockService( | 77 BluetoothGattService* MockBluetoothDevice::GetMockService( |
78 const std::string& identifier) const { | 78 const std::string& identifier) const { |
79 for (BluetoothGattService* service : mock_services_) { | 79 for (BluetoothGattService* service : mock_services_) { |
80 if (service->GetIdentifier() == identifier) | 80 if (service->GetIdentifier() == identifier) |
81 return service; | 81 return service; |
82 } | 82 } |
83 return nullptr; | 83 return nullptr; |
84 } | 84 } |
85 | 85 |
86 } // namespace device | 86 } // namespace device |
OLD | NEW |