Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1991)

Side by Side Diff: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc

Issue 2178853006: bluetooth: fuzzer: Add a connect and getPrimaryServices tokens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-fuzzer-fake-adapter-uuid
Patch Set: Format Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698