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

Side by Side Diff: device/bluetooth/test/mock_bluetooth_device.cc

Issue 1156573005: bluetooth: Browser-side implementation of getCharacteristic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-get-primary-service-initial
Patch Set: Address scheib's and nick's comments Created 5 years, 6 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 (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
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 std::vector<BluetoothGattService*> MockBluetoothDevice::GetMockServices() 65 std::vector<BluetoothGattService*> MockBluetoothDevice::GetMockServices()
66 const { 66 const {
67 std::vector<BluetoothGattService*> services; 67 std::vector<BluetoothGattService*> services;
68 for (BluetoothGattService* service : mock_services_) { 68 for (BluetoothGattService* service : mock_services_) {
69 services.push_back(service); 69 services.push_back(service);
70 } 70 }
71 return services; 71 return services;
72 } 72 }
73 73
74 BluetoothGattService* MockBluetoothDevice::GetMockService(
75 const std::string& identifier) const {
76 for (BluetoothGattService* service : mock_services_) {
77 if (service->GetIdentifier() == identifier) {
78 return service;
79 }
armansito 2015/06/09 19:23:49 nit: No need for curly braces here.
ortuno 2015/06/09 20:46:42 Done.
80 }
81 return nullptr;
82 }
83
74 } // namespace device 84 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698