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

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

Issue 2510323002: bluetooth: Implement acceptAllDevices (Closed)
Patch Set: clean up Created 4 years 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 738685a8bc28601c1a1878c2adab5952717a2587..16b3c54101fe862d446299187044c16ed8f82ab3 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
@@ -188,6 +188,10 @@ LayoutTestBluetoothAdapterProvider::GetBluetoothAdapter(
return GetMissingCharacteristicHeartRateAdapter();
if (fake_adapter_name == "HeartRateAdapter")
return GetHeartRateAdapter();
+ if (fake_adapter_name == "EmptyNameDeviceAdapter")
+ return GetEmptyNameDeviceAdapter();
+ if (fake_adapter_name == "NoNameDeviceAdapter")
+ return GetNoNameDeviceAdapter();
if (fake_adapter_name == "EmptyNameHeartRateAdapter")
return GetEmptyNameHeartRateAdapter();
if (fake_adapter_name == "NoNameHeartRateAdapter")
@@ -715,6 +719,28 @@ LayoutTestBluetoothAdapterProvider::GetDisconnectingHealthThermometer() {
// static
scoped_refptr<NiceMockBluetoothAdapter>
+LayoutTestBluetoothAdapterProvider::GetEmptyNameDeviceAdapter() {
+ scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter());
+ std::unique_ptr<NiceMockBluetoothDevice> device(
+ GetConnectableDevice(adapter.get(), "" /* device_name */));
+
+ adapter->AddMockDevice(std::move(device));
+ return adapter;
+}
+
+// static
+scoped_refptr<NiceMockBluetoothAdapter>
+LayoutTestBluetoothAdapterProvider::GetNoNameDeviceAdapter() {
+ scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter());
+ std::unique_ptr<NiceMockBluetoothDevice> device(
+ GetConnectableDevice(adapter.get(), nullptr /* device_name */));
+
+ adapter->AddMockDevice(std::move(device));
+ return adapter;
+}
+
+// static
+scoped_refptr<NiceMockBluetoothAdapter>
LayoutTestBluetoothAdapterProvider::GetEmptyNameHeartRateAdapter() {
scoped_refptr<NiceMockBluetoothAdapter> adapter(GetEmptyAdapter());
std::unique_ptr<NiceMockBluetoothDevice> device(

Powered by Google App Engine
This is Rietveld 408576698