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

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

Issue 2637343002: Implement WebBluetooth descriptor.readValue() (Closed)
Patch Set: #1 Created 3 years, 11 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 const char kHeartRateMeasurementUUID[] = "2a37"; 90 const char kHeartRateMeasurementUUID[] = "2a37";
91 const char kSerialNumberStringUUID[] = "2a25"; 91 const char kSerialNumberStringUUID[] = "2a25";
92 const char kPeripheralPrivacyFlagUUID[] = "2a02"; 92 const char kPeripheralPrivacyFlagUUID[] = "2a02";
93 // Descriptors: 93 // Descriptors:
94 const char kUserDescriptionUUID[] = "2901"; 94 const char kUserDescriptionUUID[] = "2901";
95 // Client Config is in our blocklist. It must not be writable 95 // Client Config is in our blocklist. It must not be writable
96 const char kClientConfigUUID[] = "2902"; 96 const char kClientConfigUUID[] = "2902";
97 // Blocklisted descriptor 97 // Blocklisted descriptor
98 const char kBlocklistedDescriptorUUID[] = 98 const char kBlocklistedDescriptorUUID[] =
99 "bad2ddcf-60db-45cd-bef9-fd72b153cf7c"; 99 "bad2ddcf-60db-45cd-bef9-fd72b153cf7c";
100 const char kCharacteristicUserDescription[] =
101 "gatt.characteristic_user_description";
100 102
101 // Invokes Run() on the k-th argument of the function with no arguments. 103 // Invokes Run() on the k-th argument of the function with no arguments.
102 ACTION_TEMPLATE(RunCallback, 104 ACTION_TEMPLATE(RunCallback,
103 HAS_1_TEMPLATE_PARAMS(int, k), 105 HAS_1_TEMPLATE_PARAMS(int, k),
104 AND_0_VALUE_PARAMS()) { 106 AND_0_VALUE_PARAMS()) {
105 return ::testing::get<k>(args).Run(); 107 return ::testing::get<k>(args).Run();
106 } 108 }
107 109
108 // Invokes Run() on the k-th argument of the function with 1 argument. 110 // Invokes Run() on the k-th argument of the function with 1 argument.
109 ACTION_TEMPLATE(RunCallback, 111 ACTION_TEMPLATE(RunCallback,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 observer.GattServicesDiscovered(adapter, device); 155 observer.GattServicesDiscovered(adapter, device);
154 } 156 }
155 157
156 // Notifies the adapter's observers that a device has changed. 158 // Notifies the adapter's observers that a device has changed.
157 void NotifyDeviceChanged(MockBluetoothAdapter* adapter, 159 void NotifyDeviceChanged(MockBluetoothAdapter* adapter,
158 MockBluetoothDevice* device) { 160 MockBluetoothDevice* device) {
159 for (auto& observer : adapter->GetObservers()) 161 for (auto& observer : adapter->GetObservers())
160 observer.DeviceChanged(adapter, device); 162 observer.DeviceChanged(adapter, device);
161 } 163 }
162 164
163 void PerformReadValue( 165 void PerformCharacteristicReadValue(
164 MockBluetoothAdapter* adapter, 166 MockBluetoothAdapter* adapter,
165 MockBluetoothGattCharacteristic* characteristic, 167 MockBluetoothGattCharacteristic* characteristic,
166 const BluetoothRemoteGattCharacteristic::ValueCallback& callback, 168 const BluetoothRemoteGattCharacteristic::ValueCallback& callback,
167 const std::vector<uint8_t>& value) { 169 const std::vector<uint8_t>& value) {
168 for (auto& observer : adapter->GetObservers()) { 170 for (auto& observer : adapter->GetObservers()) {
169 observer.GattCharacteristicValueChanged(adapter, characteristic, value); 171 observer.GattCharacteristicValueChanged(adapter, characteristic, value);
170 } 172 }
171 callback.Run(value); 173 callback.Run(value);
172 } 174 }
173 175
176 void PerformDescriptorReadValue(
177 MockBluetoothAdapter* adapter,
178 MockBluetoothGattDescriptor* descriptor,
179 const BluetoothRemoteGattDescriptor::ValueCallback& callback,
180 const std::vector<uint8_t>& value) {
181 for (auto& observer : adapter->GetObservers()) {
182 observer.GattDescriptorValueChanged(adapter, descriptor, value);
183 }
184 callback.Run(value);
185 }
186
174 } // namespace 187 } // namespace
175 188
176 namespace content { 189 namespace content {
177 190
178 // static 191 // static
179 scoped_refptr<BluetoothAdapter> 192 scoped_refptr<BluetoothAdapter>
180 LayoutTestBluetoothAdapterProvider::GetBluetoothAdapter( 193 LayoutTestBluetoothAdapterProvider::GetBluetoothAdapter(
181 const std::string& fake_adapter_name) { 194 const std::string& fake_adapter_name) {
182 if (fake_adapter_name == "BaseAdapter") 195 if (fake_adapter_name == "BaseAdapter")
183 return GetBaseAdapter(); 196 return GetBaseAdapter();
(...skipping 23 matching lines...) Expand all
207 return GetNoNameDeviceAdapter(); 220 return GetNoNameDeviceAdapter();
208 if (fake_adapter_name == "EmptyNameHeartRateAdapter") 221 if (fake_adapter_name == "EmptyNameHeartRateAdapter")
209 return GetEmptyNameHeartRateAdapter(); 222 return GetEmptyNameHeartRateAdapter();
210 if (fake_adapter_name == "NoNameHeartRateAdapter") 223 if (fake_adapter_name == "NoNameHeartRateAdapter")
211 return GetNoNameHeartRateAdapter(); 224 return GetNoNameHeartRateAdapter();
212 if (fake_adapter_name == "TwoHeartRateServicesAdapter") 225 if (fake_adapter_name == "TwoHeartRateServicesAdapter")
213 return GetTwoHeartRateServicesAdapter(); 226 return GetTwoHeartRateServicesAdapter();
214 if (fake_adapter_name == "DisconnectingHeartRateAdapter") 227 if (fake_adapter_name == "DisconnectingHeartRateAdapter")
215 return GetDisconnectingHeartRateAdapter(); 228 return GetDisconnectingHeartRateAdapter();
216 if (fake_adapter_name == "DisconnectingHealthThermometerAdapter") 229 if (fake_adapter_name == "DisconnectingHealthThermometerAdapter")
217 return GetDisconnectingHealthThermometer(); 230 return GetDisconnectingHealthThermometer(true);
231 if (fake_adapter_name ==
232 "MissingDescriptorsDisconnectingHealthThermometerAdapter")
233 return GetDisconnectingHealthThermometer(false);
218 if (fake_adapter_name == "DisconnectingDuringServiceRetrievalAdapter") 234 if (fake_adapter_name == "DisconnectingDuringServiceRetrievalAdapter")
219 return GetServicesDiscoveredAfterReconnectionAdapter(true /* disconnect */); 235 return GetServicesDiscoveredAfterReconnectionAdapter(true /* disconnect */);
220 if (fake_adapter_name == "ServicesDiscoveredAfterReconnectionAdapter") 236 if (fake_adapter_name == "ServicesDiscoveredAfterReconnectionAdapter")
221 return GetServicesDiscoveredAfterReconnectionAdapter( 237 return GetServicesDiscoveredAfterReconnectionAdapter(
222 false /* disconnect */); 238 false /* disconnect */);
223 if (fake_adapter_name == "DisconnectingDuringSuccessGATTOperationAdapter") { 239 if (fake_adapter_name == "DisconnectingDuringSuccessGATTOperationAdapter") {
224 return GetGATTOperationFinishesAfterReconnectionAdapter( 240 return GetGATTOperationFinishesAfterReconnectionAdapter(
225 true /* disconnect */, true /* succeeds */); 241 true /* disconnect */, true /* succeeds */);
226 } 242 }
227 if (fake_adapter_name == "DisconnectingDuringFailureGATTOperationAdapter") { 243 if (fake_adapter_name == "DisconnectingDuringFailureGATTOperationAdapter") {
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 // See: http://crbug.com/529975 675 // See: http://crbug.com/529975
660 676
661 device->AddMockService(GetGenericAccessService(device.get())); 677 device->AddMockService(GetGenericAccessService(device.get()));
662 device->AddMockService(GetHeartRateService(adapter.get(), device.get())); 678 device->AddMockService(GetHeartRateService(adapter.get(), device.get()));
663 adapter->AddMockDevice(std::move(device)); 679 adapter->AddMockDevice(std::move(device));
664 return adapter; 680 return adapter;
665 } 681 }
666 682
667 // static 683 // static
668 scoped_refptr<NiceMockBluetoothAdapter> 684 scoped_refptr<NiceMockBluetoothAdapter>
669 LayoutTestBluetoothAdapterProvider::GetDisconnectingHealthThermometer() { 685 LayoutTestBluetoothAdapterProvider::GetDisconnectingHealthThermometer(
686 bool addDescriptors) {
670 scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter()); 687 scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter());
671 NiceMockBluetoothAdapter* adapter_ptr = adapter.get(); 688 NiceMockBluetoothAdapter* adapter_ptr = adapter.get();
672 689
673 auto device(GetConnectableDevice( 690 auto device(GetConnectableDevice(
674 adapter_ptr, "Disconnecting Health Thermometer", 691 adapter_ptr, "Disconnecting Health Thermometer",
675 std::vector<BluetoothUUID>({BluetoothUUID(kGenericAccessServiceUUID), 692 std::vector<BluetoothUUID>({BluetoothUUID(kGenericAccessServiceUUID),
676 BluetoothUUID(kHealthThermometerUUID)}))); 693 BluetoothUUID(kHealthThermometerUUID)})));
677 694
678 device->AddMockService(GetGenericAccessService(device.get())); 695 device->AddMockService(GetGenericAccessService(device.get()));
679 device->AddMockService(GetDisconnectingService(adapter.get(), device.get())); 696 device->AddMockService(GetDisconnectingService(adapter.get(), device.get()));
(...skipping 24 matching lines...) Expand all
704 721
705 ON_CALL(*measurement_interval, WriteRemoteCharacteristic(_, _, _)) 722 ON_CALL(*measurement_interval, WriteRemoteCharacteristic(_, _, _))
706 .WillByDefault(RunCallback<1 /* success_callback */>()); 723 .WillByDefault(RunCallback<1 /* success_callback */>());
707 724
708 ON_CALL(*measurement_interval, StartNotifySession(_, _)) 725 ON_CALL(*measurement_interval, StartNotifySession(_, _))
709 .WillByDefault( 726 .WillByDefault(
710 RunCallbackWithResult<0 /* success_callback */>([measurement_ptr]() { 727 RunCallbackWithResult<0 /* success_callback */>([measurement_ptr]() {
711 return GetBaseGATTNotifySession(measurement_ptr->GetWeakPtr()); 728 return GetBaseGATTNotifySession(measurement_ptr->GetWeakPtr());
712 })); 729 }));
713 730
714 auto user_description = base::MakeUnique<NiceMockBluetoothGattDescriptor>( 731 if (addDescriptors == true) {
715 measurement_interval.get(), "gatt.characteristic_user_description", 732 std::string descriptorName = kCharacteristicUserDescription;
716 BluetoothUUID(kUserDescriptionUUID), false, 733 auto user_description = base::MakeUnique<NiceMockBluetoothGattDescriptor>(
717 device::BluetoothRemoteGattCharacteristic::PROPERTY_READ); 734 measurement_interval.get(), descriptorName,
735 BluetoothUUID(kUserDescriptionUUID), false,
736 device::BluetoothRemoteGattCharacteristic::PROPERTY_READ);
718 737
719 auto client_config = base::MakeUnique<NiceMockBluetoothGattDescriptor>( 738 ON_CALL(*user_description, ReadRemoteDescriptor(_, _))
720 measurement_interval.get(), "gatt.client_characteristic_configuration", 739 .WillByDefault(Invoke([descriptorName](
721 BluetoothUUID(kClientConfigUUID), false, 740 const BluetoothRemoteGattDescriptor::ValueCallback& callback,
722 device::BluetoothRemoteGattCharacteristic::PROPERTY_READ | 741 const BluetoothRemoteGattDescriptor::ErrorCallback&) {
723 device::BluetoothRemoteGattCharacteristic::PROPERTY_WRITE); 742 std::vector<uint8_t> value(descriptorName.begin(),
743 descriptorName.end());
744 callback.Run(value);
745 }));
724 746
725 // Add it here with full permission as the blocklist should prevent us from 747 auto client_config = base::MakeUnique<NiceMockBluetoothGattDescriptor>(
726 // accessing this descriptor 748 measurement_interval.get(), "gatt.client_characteristic_configuration",
727 auto blocklisted_descriptor = 749 BluetoothUUID(kClientConfigUUID), false,
728 base::MakeUnique<NiceMockBluetoothGattDescriptor>( 750 device::BluetoothRemoteGattCharacteristic::PROPERTY_READ |
729 measurement_interval.get(), "bad2ddcf-60db-45cd-bef9-fd72b153cf7c", 751 device::BluetoothRemoteGattCharacteristic::PROPERTY_WRITE);
730 BluetoothUUID(kBlocklistedDescriptorUUID), false,
731 device::BluetoothRemoteGattCharacteristic::PROPERTY_READ |
732 device::BluetoothRemoteGattCharacteristic::PROPERTY_WRITE);
733 752
734 measurement_interval->AddMockDescriptor(std::move(user_description)); 753 // Add it here with full permission as the blocklist should prevent us from
735 measurement_interval->AddMockDescriptor(std::move(client_config)); 754 // accessing this descriptor
736 measurement_interval->AddMockDescriptor(std::move(blocklisted_descriptor)); 755 auto blocklisted_descriptor =
756 base::MakeUnique<NiceMockBluetoothGattDescriptor>(
757 measurement_interval.get(), "bad2ddcf-60db-45cd-bef9-fd72b153cf7c",
758 BluetoothUUID(kBlocklistedDescriptorUUID), false,
759 device::BluetoothRemoteGattCharacteristic::PROPERTY_READ |
760 device::BluetoothRemoteGattCharacteristic::PROPERTY_WRITE);
737 761
762 measurement_interval->AddMockDescriptor(std::move(user_description));
763 measurement_interval->AddMockDescriptor(std::move(client_config));
764 measurement_interval->AddMockDescriptor(std::move(blocklisted_descriptor));
765 }
738 health_thermometer->AddMockCharacteristic(std::move(measurement_interval)); 766 health_thermometer->AddMockCharacteristic(std::move(measurement_interval));
739 device->AddMockService(std::move(health_thermometer)); 767 device->AddMockService(std::move(health_thermometer));
740 768
741 adapter->AddMockDevice(std::move(device)); 769 adapter->AddMockDevice(std::move(device));
742 770
743 return adapter; 771 return adapter;
744 } 772 }
745 773
746 // static 774 // static
747 scoped_refptr<NiceMockBluetoothAdapter> 775 scoped_refptr<NiceMockBluetoothAdapter>
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 measurement_interval.get(); 995 measurement_interval.get();
968 996
969 ON_CALL(*measurement_interval, ReadRemoteCharacteristic(_, _)) 997 ON_CALL(*measurement_interval, ReadRemoteCharacteristic(_, _))
970 .WillByDefault(Invoke([adapter_ptr, device_ptr, measurement_ptr, 998 .WillByDefault(Invoke([adapter_ptr, device_ptr, measurement_ptr,
971 disconnect, succeeds]( 999 disconnect, succeeds](
972 const BluetoothRemoteGattCharacteristic::ValueCallback& callback, 1000 const BluetoothRemoteGattCharacteristic::ValueCallback& callback,
973 const BluetoothRemoteGattCharacteristic::ErrorCallback& 1001 const BluetoothRemoteGattCharacteristic::ErrorCallback&
974 error_callback) { 1002 error_callback) {
975 base::Closure pending; 1003 base::Closure pending;
976 if (succeeds) { 1004 if (succeeds) {
977 pending = 1005 pending = base::Bind(&PerformCharacteristicReadValue,
978 base::Bind(&PerformReadValue, base::RetainedRef(adapter_ptr), 1006 base::RetainedRef(adapter_ptr), measurement_ptr,
979 measurement_ptr, callback, std::vector<uint8_t>({1})); 1007 callback, std::vector<uint8_t>({1}));
980 } else { 1008 } else {
981 pending = base::Bind(error_callback, 1009 pending = base::Bind(error_callback,
982 BluetoothRemoteGattService::GATT_ERROR_FAILED); 1010 BluetoothRemoteGattService::GATT_ERROR_FAILED);
983 } 1011 }
984 device_ptr->PushPendingCallback(pending); 1012 device_ptr->PushPendingCallback(pending);
985 if (disconnect) { 1013 if (disconnect) {
986 device_ptr->SetConnected(false); 1014 device_ptr->SetConnected(false);
987 base::ThreadTaskRunnerHandle::Get()->PostTask( 1015 base::ThreadTaskRunnerHandle::Get()->PostTask(
988 FROM_HERE, 1016 FROM_HERE,
989 base::Bind(&NotifyDeviceChanged, base::RetainedRef(adapter_ptr), 1017 base::Bind(&NotifyDeviceChanged, base::RetainedRef(adapter_ptr),
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 device_ptr->PushPendingCallback(pending); 1059 device_ptr->PushPendingCallback(pending);
1032 if (disconnect) { 1060 if (disconnect) {
1033 device_ptr->SetConnected(false); 1061 device_ptr->SetConnected(false);
1034 base::ThreadTaskRunnerHandle::Get()->PostTask( 1062 base::ThreadTaskRunnerHandle::Get()->PostTask(
1035 FROM_HERE, 1063 FROM_HERE,
1036 base::Bind(&NotifyDeviceChanged, base::RetainedRef(adapter_ptr), 1064 base::Bind(&NotifyDeviceChanged, base::RetainedRef(adapter_ptr),
1037 device_ptr)); 1065 device_ptr));
1038 } 1066 }
1039 })); 1067 }));
1040 1068
1069 auto user_descriptor = base::MakeUnique<NiceMockBluetoothGattDescriptor>(
1070 measurement_interval.get(), kCharacteristicUserDescription,
1071 BluetoothUUID(kUserDescriptionUUID), false,
1072 device::BluetoothRemoteGattCharacteristic::PROPERTY_READ);
1073
1074 NiceMockBluetoothGattDescriptor* user_descriptor_ptr = user_descriptor.get();
1075 ON_CALL(*user_descriptor, ReadRemoteDescriptor(_, _))
1076 .WillByDefault(Invoke([adapter_ptr, device_ptr, user_descriptor_ptr,
1077 disconnect, succeeds](
1078 const BluetoothRemoteGattDescriptor::ValueCallback& callback,
1079 const BluetoothRemoteGattDescriptor::ErrorCallback& error_callback) {
1080 base::Closure pending;
1081 if (succeeds) {
1082 pending = base::Bind(
1083 &PerformDescriptorReadValue, base::RetainedRef(adapter_ptr),
1084 user_descriptor_ptr, callback, std::vector<uint8_t>({1}));
1085 } else {
1086 pending = base::Bind(error_callback,
1087 BluetoothRemoteGattService::GATT_ERROR_FAILED);
1088 }
1089 device_ptr->PushPendingCallback(pending);
1090 if (disconnect) {
1091 device_ptr->SetConnected(false);
1092 base::ThreadTaskRunnerHandle::Get()->PostTask(
1093 FROM_HERE,
1094 base::Bind(&NotifyDeviceChanged, base::RetainedRef(adapter_ptr),
1095 device_ptr));
1096 }
1097 }));
1098
1099 measurement_interval->AddMockDescriptor(std::move(user_descriptor));
1100
1041 health_thermometer->AddMockCharacteristic(std::move(measurement_interval)); 1101 health_thermometer->AddMockCharacteristic(std::move(measurement_interval));
1042 device->AddMockService(std::move(health_thermometer)); 1102 device->AddMockService(std::move(health_thermometer));
1043 adapter->AddMockDevice(std::move(device)); 1103 adapter->AddMockDevice(std::move(device));
1044 return adapter; 1104 return adapter;
1045 } 1105 }
1046 1106
1047 // static 1107 // static
1048 scoped_refptr<NiceMockBluetoothAdapter> LayoutTestBluetoothAdapterProvider:: 1108 scoped_refptr<NiceMockBluetoothAdapter> LayoutTestBluetoothAdapterProvider::
1049 GetStopNotifySessionFinishesAfterReconnectionAdapter(bool disconnect) { 1109 GetStopNotifySessionFinishesAfterReconnectionAdapter(bool disconnect) {
1050 scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter()); 1110 scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter());
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 .WillByDefault(RunCallback<1 /* error_callback */>(error_code)); 1679 .WillByDefault(RunCallback<1 /* error_callback */>(error_code));
1620 1680
1621 // Write response. 1681 // Write response.
1622 ON_CALL(*characteristic, WriteRemoteCharacteristic(_, _, _)) 1682 ON_CALL(*characteristic, WriteRemoteCharacteristic(_, _, _))
1623 .WillByDefault(RunCallback<2 /* error_callback */>(error_code)); 1683 .WillByDefault(RunCallback<2 /* error_callback */>(error_code));
1624 1684
1625 // StartNotifySession response 1685 // StartNotifySession response
1626 ON_CALL(*characteristic, StartNotifySession(_, _)) 1686 ON_CALL(*characteristic, StartNotifySession(_, _))
1627 .WillByDefault(RunCallback<1 /* error_callback */>(error_code)); 1687 .WillByDefault(RunCallback<1 /* error_callback */>(error_code));
1628 1688
1689 // Add error descriptor to |characteristic|
1690 auto error_descriptor = base::MakeUnique<NiceMockBluetoothGattDescriptor>(
1691 characteristic.get(), kCharacteristicUserDescription,
1692 BluetoothUUID(kUserDescriptionUUID), false,
1693 device::BluetoothRemoteGattCharacteristic::PROPERTY_READ);
1694
1695 ON_CALL(*error_descriptor, ReadRemoteDescriptor(_, _))
1696 .WillByDefault(RunCallback<1 /* error_callback */>(error_code));
1697
1698 characteristic->AddMockDescriptor(std::move(error_descriptor));
1699
1629 return characteristic; 1700 return characteristic;
1630 } 1701 }
1631 1702
1632 // Notify sessions 1703 // Notify sessions
1633 1704
1634 // static 1705 // static
1635 std::unique_ptr<NiceMockBluetoothGattNotifySession> 1706 std::unique_ptr<NiceMockBluetoothGattNotifySession>
1636 LayoutTestBluetoothAdapterProvider::GetBaseGATTNotifySession( 1707 LayoutTestBluetoothAdapterProvider::GetBaseGATTNotifySession(
1637 base::WeakPtr<device::BluetoothRemoteGattCharacteristic> characteristic) { 1708 base::WeakPtr<device::BluetoothRemoteGattCharacteristic> characteristic) {
1638 auto session = 1709 auto session =
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 NOTREACHED(); 1770 NOTREACHED();
1700 return BluetoothUUID(); 1771 return BluetoothUUID();
1701 } 1772 }
1702 1773
1703 // static 1774 // static
1704 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) { 1775 std::string LayoutTestBluetoothAdapterProvider::makeMACAddress(uint64_t addr) {
1705 return BluetoothDevice::CanonicalizeAddress( 1776 return BluetoothDevice::CanonicalizeAddress(
1706 base::StringPrintf("%012" PRIx64, addr)); 1777 base::StringPrintf("%012" PRIx64, addr));
1707 } 1778 }
1708 1779
1709 } // namespace content 1780 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698