| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/shell/browser/layout_test/layout_test_bluetooth_adapter_provid
er.h" | 5 #include "content/shell/browser/layout_test/layout_test_bluetooth_adapter_provid
er.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 ON_CALL(*device, GetGattServices()) | 600 ON_CALL(*device, GetGattServices()) |
| 601 .WillByDefault( | 601 .WillByDefault( |
| 602 Invoke(device.get(), &MockBluetoothDevice::GetMockServices)); | 602 Invoke(device.get(), &MockBluetoothDevice::GetMockServices)); |
| 603 // The call to BluetoothDevice::GetGattService will invoke ::GetMockService | 603 // The call to BluetoothDevice::GetGattService will invoke ::GetMockService |
| 604 // which returns a service matching the identifier provided if the service | 604 // which returns a service matching the identifier provided if the service |
| 605 // was added to the mock. | 605 // was added to the mock. |
| 606 ON_CALL(*device, GetGattService(_)) | 606 ON_CALL(*device, GetGattService(_)) |
| 607 .WillByDefault( | 607 .WillByDefault( |
| 608 Invoke(device.get(), &MockBluetoothDevice::GetMockService)); | 608 Invoke(device.get(), &MockBluetoothDevice::GetMockService)); |
| 609 | 609 |
| 610 ON_CALL(*device, GetVendorIDSource()) | |
| 611 .WillByDefault(Return(BluetoothDevice::VENDOR_ID_BLUETOOTH)); | |
| 612 ON_CALL(*device, GetVendorID()).WillByDefault(Return(0xFFFF)); | |
| 613 ON_CALL(*device, GetProductID()).WillByDefault(Return(1)); | |
| 614 ON_CALL(*device, GetDeviceID()).WillByDefault(Return(2)); | |
| 615 | |
| 616 return device; | 610 return device; |
| 617 } | 611 } |
| 618 | 612 |
| 619 // static | 613 // static |
| 620 std::unique_ptr<NiceMockBluetoothDevice> | 614 std::unique_ptr<NiceMockBluetoothDevice> |
| 621 LayoutTestBluetoothAdapterProvider::GetBatteryDevice( | 615 LayoutTestBluetoothAdapterProvider::GetBatteryDevice( |
| 622 MockBluetoothAdapter* adapter) { | 616 MockBluetoothAdapter* adapter) { |
| 623 BluetoothDevice::UUIDList uuids; | 617 BluetoothDevice::UUIDList uuids; |
| 624 uuids.push_back(BluetoothUUID(kBatteryServiceUUID)); | 618 uuids.push_back(BluetoothUUID(kBatteryServiceUUID)); |
| 625 | 619 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 return BluetoothUUID(); | 1030 return BluetoothUUID(); |
| 1037 } | 1031 } |
| 1038 | 1032 |
| 1039 // static | 1033 // static |
| 1040 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { | 1034 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { |
| 1041 return BluetoothDevice::CanonicalizeAddress( | 1035 return BluetoothDevice::CanonicalizeAddress( |
| 1042 base::StringPrintf("%012" PRIx64, addr)); | 1036 base::StringPrintf("%012" PRIx64, addr)); |
| 1043 } | 1037 } |
| 1044 | 1038 |
| 1045 } // namespace content | 1039 } // namespace content |
| OLD | NEW |