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/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 Loading... |
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 const { |
| 67 std::vector<BluetoothGattService*> services; |
| 68 for (BluetoothGattService* service : mock_services_) { |
| 69 services.push_back(service); |
| 70 } |
| 71 return services; |
| 72 } |
| 73 |
59 } // namespace device | 74 } // namespace device |
OLD | NEW |