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

Unified Diff: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc

Issue 1149883011: bluetooth: Browser-side implementation of readValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-get-characteristic-initial
Patch Set: Fix bad_messages.h and histrograms.xml 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc
diff --git a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc
index 7f3563fe98c6fe9414363da271b42ac815098454..aff0745edb11545d9e473f4f2644007ffa0e7235 100644
--- a/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc
+++ b/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.cc
@@ -178,9 +178,15 @@ LayoutTestBluetoothAdapterProvider::GetEmptyDevice(
scoped_ptr<NiceMock<MockBluetoothGattService>> generic_access(
GetGattService(empty_device.get(), "1800" /* Generic Access */));
- generic_access->AddMockCharacteristic(
+ scoped_ptr<NiceMock<MockBluetoothGattCharacteristic>> device_name(
GetGattCharacteristic(generic_access.get(), "2A00" /* Device Name */));
+ std::string value_str("Empty Mock Device name");
+ std::vector<uint8_t> value(value_str.begin(), value_str.end());
+ ON_CALL(*device_name, ReadRemoteCharacteristic(_, _))
+ .WillByDefault(RunCallback<0>(value));
+ generic_access->AddMockCharacteristic(device_name.Pass());
+
scoped_ptr<NiceMock<MockBluetoothGattService>> generic_attribute(
GetGattService(empty_device.get(), "1801" /* Generic Attribute */));
generic_attribute->AddMockCharacteristic(GetGattCharacteristic(
@@ -250,6 +256,11 @@ LayoutTestBluetoothAdapterProvider::GetGattService(MockBluetoothDevice* device,
ON_CALL(*service, GetCharacteristics())
.WillByDefault(Invoke(service.get(),
&MockBluetoothGattService::GetMockCharacteristics));
+
+ ON_CALL(*service, GetCharacteristic(_))
+ .WillByDefault(Invoke(service.get(),
+ &MockBluetoothGattService::GetMockCharacteristic));
+
return service.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698