| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 ON_CALL(*device, GetGattServices()) | 646 ON_CALL(*device, GetGattServices()) |
| 647 .WillByDefault( | 647 .WillByDefault( |
| 648 Invoke(device.get(), &MockBluetoothDevice::GetMockServices)); | 648 Invoke(device.get(), &MockBluetoothDevice::GetMockServices)); |
| 649 // The call to BluetoothDevice::GetGattService will invoke ::GetMockService | 649 // The call to BluetoothDevice::GetGattService will invoke ::GetMockService |
| 650 // which returns a service matching the identifier provided if the service | 650 // which returns a service matching the identifier provided if the service |
| 651 // was added to the mock. | 651 // was added to the mock. |
| 652 ON_CALL(*device, GetGattService(_)) | 652 ON_CALL(*device, GetGattService(_)) |
| 653 .WillByDefault( | 653 .WillByDefault( |
| 654 Invoke(device.get(), &MockBluetoothDevice::GetMockService)); | 654 Invoke(device.get(), &MockBluetoothDevice::GetMockService)); |
| 655 | 655 |
| 656 ON_CALL(*device, CreateGattConnection(_, _)) |
| 657 .WillByDefault(RunCallback<1 /* error_callback */>( |
| 658 BluetoothDevice::ERROR_UNSUPPORTED_DEVICE)); |
| 659 |
| 656 return device; | 660 return device; |
| 657 } | 661 } |
| 658 | 662 |
| 659 // static | 663 // static |
| 660 std::unique_ptr<NiceMockBluetoothDevice> | 664 std::unique_ptr<NiceMockBluetoothDevice> |
| 661 LayoutTestBluetoothAdapterProvider::GetBatteryDevice( | 665 LayoutTestBluetoothAdapterProvider::GetBatteryDevice( |
| 662 MockBluetoothAdapter* adapter) { | 666 MockBluetoothAdapter* adapter) { |
| 663 BluetoothDevice::UUIDList uuids; | 667 BluetoothDevice::UUIDList uuids; |
| 664 uuids.push_back(BluetoothUUID(kBatteryServiceUUID)); | 668 uuids.push_back(BluetoothUUID(kBatteryServiceUUID)); |
| 665 | 669 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 return BluetoothUUID(); | 1082 return BluetoothUUID(); |
| 1079 } | 1083 } |
| 1080 | 1084 |
| 1081 // static | 1085 // static |
| 1082 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { | 1086 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { |
| 1083 return BluetoothDevice::CanonicalizeAddress( | 1087 return BluetoothDevice::CanonicalizeAddress( |
| 1084 base::StringPrintf("%012" PRIx64, addr)); | 1088 base::StringPrintf("%012" PRIx64, addr)); |
| 1085 } | 1089 } |
| 1086 | 1090 |
| 1087 } // namespace content | 1091 } // namespace content |
| OLD | NEW |