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

Unified Diff: device/bluetooth/bluetooth_adapter_unittest.cc

Issue 1412023002: bluetooth: mac: Only test Low Energy discovery sessions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@btm-key-strings-
Patch Set: Created 5 years, 2 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: device/bluetooth/bluetooth_adapter_unittest.cc
diff --git a/device/bluetooth/bluetooth_adapter_unittest.cc b/device/bluetooth/bluetooth_adapter_unittest.cc
index e08a14b7647b502c8e3a846bf6afa2c605274083..509f0ed48195f52e8b1b05e1cd001f88eee4d931 100644
--- a/device/bluetooth/bluetooth_adapter_unittest.cc
+++ b/device/bluetooth/bluetooth_adapter_unittest.cc
@@ -457,8 +457,7 @@ TEST_F(BluetoothTest, DiscoverySession) {
InitWithFakeAdapter();
EXPECT_FALSE(adapter_->IsDiscovering());
- adapter_->StartDiscoverySession(GetDiscoverySessionCallback(),
- GetErrorCallback());
+ StartLowEnergyDiscoverySession();
EXPECT_EQ(1, callback_count_);
EXPECT_EQ(0, error_callback_count_);
EXPECT_TRUE(adapter_->IsDiscovering());
@@ -485,12 +484,7 @@ TEST_F(BluetoothTest, DiscoverLowEnergyDevice) {
TestBluetoothAdapterObserver observer(adapter_);
// Start discovery and find a device.
- scoped_ptr<BluetoothDiscoveryFilter> discovery_filter(
- new BluetoothDiscoveryFilter(
- BluetoothDiscoveryFilter::Transport::TRANSPORT_LE));
- adapter_->StartDiscoverySessionWithFilter(discovery_filter.Pass(),
- GetDiscoverySessionCallback(),
- GetErrorCallback());
+ StartLowEnergyDiscoverySession();
DiscoverLowEnergyDevice(1);
EXPECT_EQ(1, observer.device_added_count());
BluetoothDevice* device = adapter_->GetDevice(observer.last_device_address());
@@ -509,8 +503,7 @@ TEST_F(BluetoothTest, DiscoverLowEnergyDeviceTwice) {
TestBluetoothAdapterObserver observer(adapter_);
// Start discovery and find a device.
- adapter_->StartDiscoverySession(GetDiscoverySessionCallback(),
- GetErrorCallback());
+ StartLowEnergyDiscoverySession();
DiscoverLowEnergyDevice(1);
EXPECT_EQ(1, observer.device_added_count());
BluetoothDevice* device = adapter_->GetDevice(observer.last_device_address());
@@ -536,8 +529,7 @@ TEST_F(BluetoothTest, DiscoverLowEnergyDeviceWithUpdatedUUIDs) {
TestBluetoothAdapterObserver observer(adapter_);
// Start discovery and find a device.
- adapter_->StartDiscoverySession(GetDiscoverySessionCallback(),
- GetErrorCallback());
+ StartLowEnergyDiscoverySession();
BluetoothDevice* device = DiscoverLowEnergyDevice(1);
// Check the initial UUIDs:
@@ -584,8 +576,7 @@ TEST_F(BluetoothTest, DiscoverMultipleLowEnergyDevices) {
TestBluetoothAdapterObserver observer(adapter_);
// Start discovery and find a device.
- adapter_->StartDiscoverySession(GetDiscoverySessionCallback(),
- GetErrorCallback());
+ StartLowEnergyDiscoverySession();
DiscoverLowEnergyDevice(1);
DiscoverLowEnergyDevice(4);
EXPECT_EQ(2, observer.device_added_count());
« no previous file with comments | « no previous file | device/bluetooth/bluetooth_device_unittest.cc » ('j') | device/bluetooth/test/bluetooth_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698