Index: device/bluetooth/bluetooth_bluez_unittest.cc |
diff --git a/device/bluetooth/bluetooth_chromeos_unittest.cc b/device/bluetooth/bluetooth_bluez_unittest.cc |
similarity index 88% |
rename from device/bluetooth/bluetooth_chromeos_unittest.cc |
rename to device/bluetooth/bluetooth_bluez_unittest.cc |
index cea92d92b2532e821b970f582c7af16141f96ba6..315a70486183db15cc3772f7ebae0f2d3da93239 100644 |
--- a/device/bluetooth/bluetooth_chromeos_unittest.cc |
+++ b/device/bluetooth/bluetooth_bluez_unittest.cc |
@@ -8,12 +8,12 @@ |
#include "base/strings/utf_string_conversions.h" |
#include "dbus/object_path.h" |
#include "device/bluetooth/bluetooth_adapter.h" |
-#include "device/bluetooth/bluetooth_adapter_chromeos.h" |
+#include "device/bluetooth/bluetooth_adapter_bluez.h" |
#include "device/bluetooth/bluetooth_adapter_factory.h" |
#include "device/bluetooth/bluetooth_device.h" |
-#include "device/bluetooth/bluetooth_device_chromeos.h" |
+#include "device/bluetooth/bluetooth_device_bluez.h" |
#include "device/bluetooth/bluetooth_discovery_session.h" |
-#include "device/bluetooth/bluetooth_pairing_chromeos.h" |
+#include "device/bluetooth/bluetooth_pairing_bluez.h" |
#include "device/bluetooth/dbus/bluez_dbus_manager.h" |
#include "device/bluetooth/dbus/fake_bluetooth_adapter_client.h" |
#include "device/bluetooth/dbus/fake_bluetooth_agent_manager_client.h" |
@@ -33,7 +33,7 @@ using device::BluetoothDiscoverySession; |
using device::BluetoothUUID; |
using device::TestBluetoothAdapterObserver; |
-namespace chromeos { |
+namespace bluez { |
namespace { |
@@ -163,7 +163,7 @@ class TestPairingDelegate : public BluetoothDevice::PairingDelegate { |
} |
}; |
-class BluetoothChromeOSTest : public testing::Test { |
+class BluetoothBlueZTest : public testing::Test { |
public: |
void SetUp() override { |
scoped_ptr<bluez::BluezDBusManagerSetter> dbus_setter = |
@@ -199,9 +199,8 @@ class BluetoothChromeOSTest : public testing::Test { |
void TearDown() override { |
for (ScopedVector<BluetoothDiscoverySession>::iterator iter = |
- discovery_sessions_.begin(); |
- iter != discovery_sessions_.end(); |
- ++iter) { |
+ discovery_sessions_.begin(); |
+ iter != discovery_sessions_.end(); ++iter) { |
BluetoothDiscoverySession* session = *iter; |
if (!session->IsActive()) |
continue; |
@@ -222,7 +221,7 @@ class BluetoothChromeOSTest : public testing::Test { |
} |
base::Closure GetCallback() { |
- return base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)); |
+ return base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)); |
} |
void DiscoverySessionCallback( |
@@ -237,7 +236,7 @@ class BluetoothChromeOSTest : public testing::Test { |
QuitMessageLoop(); |
} |
- void ProfileRegisteredCallback(BluetoothAdapterProfileChromeOS* profile) { |
+ void ProfileRegisteredCallback(BluetoothAdapterProfileBlueZ* profile) { |
adapter_profile_ = profile; |
++callback_count_; |
QuitMessageLoop(); |
@@ -253,13 +252,13 @@ class BluetoothChromeOSTest : public testing::Test { |
} |
base::Closure GetErrorCallback() { |
- return base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
+ return base::Bind(&BluetoothBlueZTest::ErrorCallback, |
base::Unretained(this)); |
} |
base::Callback<void(device::UMABluetoothDiscoverySessionOutcome)> |
GetDiscoveryErrorCallback() { |
- return base::Bind(&BluetoothChromeOSTest::DiscoveryErrorCallback, |
+ return base::Bind(&BluetoothBlueZTest::DiscoveryErrorCallback, |
base::Unretained(this)); |
} |
@@ -287,7 +286,7 @@ class BluetoothChromeOSTest : public testing::Test { |
// Call to fill the adapter_ member with a BluetoothAdapter instance. |
void GetAdapter() { |
- adapter_ = new BluetoothAdapterChromeOS(); |
+ adapter_ = new BluetoothAdapterBlueZ(); |
ASSERT_TRUE(adapter_.get() != nullptr); |
ASSERT_TRUE(adapter_->IsInitialized()); |
} |
@@ -306,7 +305,7 @@ class BluetoothChromeOSTest : public testing::Test { |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
base::MessageLoop::current()->Run(); |
@@ -350,7 +349,7 @@ class BluetoothChromeOSTest : public testing::Test { |
enum BluetoothDevice::ConnectErrorCode last_connect_error_; |
std::string last_client_error_; |
ScopedVector<BluetoothDiscoverySession> discovery_sessions_; |
- BluetoothAdapterProfileChromeOS* adapter_profile_; |
+ BluetoothAdapterProfileBlueZ* adapter_profile_; |
private: |
// Some tests use a message loop since background processing is simulated; |
@@ -363,7 +362,7 @@ class BluetoothChromeOSTest : public testing::Test { |
} |
}; |
-TEST_F(BluetoothChromeOSTest, AlreadyPresent) { |
+TEST_F(BluetoothBlueZTest, AlreadyPresent) { |
GetAdapter(); |
// This verifies that the class gets the list of adapters when created; |
@@ -389,7 +388,7 @@ TEST_F(BluetoothChromeOSTest, AlreadyPresent) { |
bluez::FakeBluetoothDeviceClient::kPairedUnconnectableDeviceAddress)); |
} |
-TEST_F(BluetoothChromeOSTest, BecomePresent) { |
+TEST_F(BluetoothBlueZTest, BecomePresent) { |
fake_bluetooth_adapter_client_->SetVisible(false); |
GetAdapter(); |
ASSERT_FALSE(adapter_->IsPresent()); |
@@ -417,7 +416,7 @@ TEST_F(BluetoothChromeOSTest, BecomePresent) { |
EXPECT_FALSE(adapter_->IsDiscovering()); |
} |
-TEST_F(BluetoothChromeOSTest, BecomeNotPresent) { |
+TEST_F(BluetoothBlueZTest, BecomeNotPresent) { |
GetAdapter(); |
ASSERT_TRUE(adapter_->IsPresent()); |
@@ -448,7 +447,7 @@ TEST_F(BluetoothChromeOSTest, BecomeNotPresent) { |
EXPECT_FALSE(adapter_->IsDiscovering()); |
} |
-TEST_F(BluetoothChromeOSTest, SecondAdapter) { |
+TEST_F(BluetoothBlueZTest, SecondAdapter) { |
GetAdapter(); |
ASSERT_TRUE(adapter_->IsPresent()); |
@@ -499,7 +498,7 @@ TEST_F(BluetoothChromeOSTest, SecondAdapter) { |
EXPECT_EQ(0, observer.discovering_changed_count()); |
} |
-TEST_F(BluetoothChromeOSTest, BecomePowered) { |
+TEST_F(BluetoothBlueZTest, BecomePowered) { |
GetAdapter(); |
ASSERT_FALSE(adapter_->IsPowered()); |
@@ -517,7 +516,7 @@ TEST_F(BluetoothChromeOSTest, BecomePowered) { |
EXPECT_TRUE(adapter_->IsPowered()); |
} |
-TEST_F(BluetoothChromeOSTest, BecomeNotPowered) { |
+TEST_F(BluetoothBlueZTest, BecomeNotPowered) { |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
EXPECT_EQ(1, callback_count_); |
@@ -540,7 +539,7 @@ TEST_F(BluetoothChromeOSTest, BecomeNotPowered) { |
EXPECT_FALSE(adapter_->IsPowered()); |
} |
-TEST_F(BluetoothChromeOSTest, SetPoweredWhenNotPresent) { |
+TEST_F(BluetoothBlueZTest, SetPoweredWhenNotPresent) { |
GetAdapter(); |
ASSERT_TRUE(adapter_->IsPresent()); |
@@ -566,7 +565,7 @@ TEST_F(BluetoothChromeOSTest, SetPoweredWhenNotPresent) { |
EXPECT_FALSE(adapter_->IsPowered()); |
} |
-TEST_F(BluetoothChromeOSTest, ChangeAdapterName) { |
+TEST_F(BluetoothBlueZTest, ChangeAdapterName) { |
GetAdapter(); |
static const std::string new_name(".__."); |
@@ -578,7 +577,7 @@ TEST_F(BluetoothChromeOSTest, ChangeAdapterName) { |
EXPECT_EQ(new_name, adapter_->GetName()); |
} |
-TEST_F(BluetoothChromeOSTest, ChangeAdapterNameWhenNotPresent) { |
+TEST_F(BluetoothBlueZTest, ChangeAdapterNameWhenNotPresent) { |
GetAdapter(); |
ASSERT_TRUE(adapter_->IsPresent()); |
@@ -601,7 +600,7 @@ TEST_F(BluetoothChromeOSTest, ChangeAdapterNameWhenNotPresent) { |
EXPECT_EQ("", adapter_->GetName()); |
} |
-TEST_F(BluetoothChromeOSTest, BecomeDiscoverable) { |
+TEST_F(BluetoothBlueZTest, BecomeDiscoverable) { |
GetAdapter(); |
ASSERT_FALSE(adapter_->IsDiscoverable()); |
@@ -618,7 +617,7 @@ TEST_F(BluetoothChromeOSTest, BecomeDiscoverable) { |
EXPECT_TRUE(adapter_->IsDiscoverable()); |
} |
-TEST_F(BluetoothChromeOSTest, BecomeNotDiscoverable) { |
+TEST_F(BluetoothBlueZTest, BecomeNotDiscoverable) { |
GetAdapter(); |
adapter_->SetDiscoverable(true, GetCallback(), GetErrorCallback()); |
EXPECT_EQ(1, callback_count_); |
@@ -640,7 +639,7 @@ TEST_F(BluetoothChromeOSTest, BecomeNotDiscoverable) { |
EXPECT_FALSE(adapter_->IsDiscoverable()); |
} |
-TEST_F(BluetoothChromeOSTest, SetDiscoverableWhenNotPresent) { |
+TEST_F(BluetoothBlueZTest, SetDiscoverableWhenNotPresent) { |
GetAdapter(); |
ASSERT_TRUE(adapter_->IsPresent()); |
ASSERT_FALSE(adapter_->IsDiscoverable()); |
@@ -666,12 +665,12 @@ TEST_F(BluetoothChromeOSTest, SetDiscoverableWhenNotPresent) { |
EXPECT_FALSE(adapter_->IsDiscoverable()); |
} |
-TEST_F(BluetoothChromeOSTest, StopDiscovery) { |
+TEST_F(BluetoothBlueZTest, StopDiscovery) { |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); |
@@ -705,7 +704,7 @@ TEST_F(BluetoothChromeOSTest, StopDiscovery) { |
// BluetoothDiscoverySession objects gets deleted |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); |
@@ -725,7 +724,7 @@ TEST_F(BluetoothChromeOSTest, StopDiscovery) { |
EXPECT_EQ(0, error_callback_count_); |
} |
-TEST_F(BluetoothChromeOSTest, Discovery) { |
+TEST_F(BluetoothBlueZTest, Discovery) { |
// Test a simulated discovery session. |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -734,7 +733,7 @@ TEST_F(BluetoothChromeOSTest, Discovery) { |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); |
@@ -767,11 +766,11 @@ TEST_F(BluetoothChromeOSTest, Discovery) { |
observer.last_device_address()); |
} |
-TEST_F(BluetoothChromeOSTest, PoweredAndDiscovering) { |
+TEST_F(BluetoothBlueZTest, PoweredAndDiscovering) { |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); |
@@ -833,7 +832,7 @@ TEST_F(BluetoothChromeOSTest, PoweredAndDiscovering) { |
// This unit test asserts that the basic reference counting logic works |
// correctly for discovery requests done via the BluetoothAdapter. |
-TEST_F(BluetoothChromeOSTest, MultipleDiscoverySessions) { |
+TEST_F(BluetoothBlueZTest, MultipleDiscoverySessions) { |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
EXPECT_EQ(1, callback_count_); |
@@ -850,7 +849,7 @@ TEST_F(BluetoothChromeOSTest, MultipleDiscoverySessions) { |
// Request device discovery 3 times. |
for (int i = 0; i < 3; i++) { |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
} |
@@ -888,7 +887,7 @@ TEST_F(BluetoothChromeOSTest, MultipleDiscoverySessions) { |
// Request device discovery 3 times. |
for (int i = 0; i < 3; i++) { |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
} |
@@ -937,8 +936,7 @@ TEST_F(BluetoothChromeOSTest, MultipleDiscoverySessions) { |
// This unit test asserts that the reference counting logic works correctly in |
// the cases when the adapter gets reset and D-Bus calls are made outside of |
// the BluetoothAdapter. |
-TEST_F(BluetoothChromeOSTest, |
- UnexpectedChangesDuringMultipleDiscoverySessions) { |
+TEST_F(BluetoothBlueZTest, UnexpectedChangesDuringMultipleDiscoverySessions) { |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
EXPECT_EQ(1, callback_count_); |
@@ -955,7 +953,7 @@ TEST_F(BluetoothChromeOSTest, |
// Request device discovery 3 times. |
for (int i = 0; i < 3; i++) { |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
} |
@@ -992,7 +990,7 @@ TEST_F(BluetoothChromeOSTest, |
// bluez::FakeBluetoothAdapterClient::StopDiscovery should work. |
fake_bluetooth_adapter_client_->StopDiscovery( |
dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath), |
- GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
message_loop_.Run(); |
EXPECT_EQ(2, observer.discovering_changed_count()); |
@@ -1009,7 +1007,7 @@ TEST_F(BluetoothChromeOSTest, |
// It should be possible to successfully start discovery. |
for (int i = 0; i < 2; i++) { |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
} |
@@ -1057,7 +1055,7 @@ TEST_F(BluetoothChromeOSTest, |
// application other than us. Starting and stopping discovery will succeed |
// but it won't cause the discovery state to change. |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); // Run the loop, as there should have been a D-Bus call. |
@@ -1081,7 +1079,7 @@ TEST_F(BluetoothChromeOSTest, |
// Start discovery again. |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); // Run the loop, as there should have been a D-Bus call. |
@@ -1098,7 +1096,7 @@ TEST_F(BluetoothChromeOSTest, |
// requested it via D-Bus. |
fake_bluetooth_adapter_client_->StopDiscovery( |
dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath), |
- GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
message_loop_.Run(); |
EXPECT_EQ(5, observer.discovering_changed_count()); |
@@ -1119,7 +1117,7 @@ TEST_F(BluetoothChromeOSTest, |
EXPECT_FALSE(discovery_sessions_[0]->IsActive()); |
} |
-TEST_F(BluetoothChromeOSTest, InvalidatedDiscoverySessions) { |
+TEST_F(BluetoothBlueZTest, InvalidatedDiscoverySessions) { |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
EXPECT_EQ(1, callback_count_); |
@@ -1136,7 +1134,7 @@ TEST_F(BluetoothChromeOSTest, InvalidatedDiscoverySessions) { |
// Request device discovery 3 times. |
for (int i = 0; i < 3; i++) { |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
} |
@@ -1176,7 +1174,7 @@ TEST_F(BluetoothChromeOSTest, InvalidatedDiscoverySessions) { |
// cleaned up. |
fake_bluetooth_adapter_client_->StopDiscovery( |
dbus::ObjectPath(bluez::FakeBluetoothAdapterClient::kAdapterPath), |
- GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
message_loop_.Run(); |
EXPECT_EQ(2, observer.discovering_changed_count()); |
@@ -1187,7 +1185,7 @@ TEST_F(BluetoothChromeOSTest, InvalidatedDiscoverySessions) { |
EXPECT_FALSE(discovery_sessions_[0]->IsActive()); |
} |
-TEST_F(BluetoothChromeOSTest, QueuedDiscoveryRequests) { |
+TEST_F(BluetoothBlueZTest, QueuedDiscoveryRequests) { |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
@@ -1204,7 +1202,7 @@ TEST_F(BluetoothChromeOSTest, QueuedDiscoveryRequests) { |
// Request to start discovery. The call should be pending. |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
EXPECT_EQ(0, callback_count_); |
@@ -1223,7 +1221,7 @@ TEST_F(BluetoothChromeOSTest, QueuedDiscoveryRequests) { |
// be no change in state. |
for (int i = 0; i < 2; i++) { |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
} |
@@ -1269,7 +1267,7 @@ TEST_F(BluetoothChromeOSTest, QueuedDiscoveryRequests) { |
// Request to start should get queued. |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
EXPECT_EQ(5, callback_count_); |
@@ -1301,7 +1299,7 @@ TEST_F(BluetoothChromeOSTest, QueuedDiscoveryRequests) { |
EXPECT_TRUE(discovery_sessions_[3]->IsActive()); |
} |
-TEST_F(BluetoothChromeOSTest, StartDiscoverySession) { |
+TEST_F(BluetoothBlueZTest, StartDiscoverySession) { |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
@@ -1319,7 +1317,7 @@ TEST_F(BluetoothChromeOSTest, StartDiscoverySession) { |
// Request a new discovery session. |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); |
@@ -1335,7 +1333,7 @@ TEST_F(BluetoothChromeOSTest, StartDiscoverySession) { |
// in turn will destroy the previous session. Adapter should still be |
// discovering and the reference count should be 1. |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); |
@@ -1349,7 +1347,7 @@ TEST_F(BluetoothChromeOSTest, StartDiscoverySession) { |
// Request a new session. |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
message_loop_.Run(); |
@@ -1387,7 +1385,7 @@ TEST_F(BluetoothChromeOSTest, StartDiscoverySession) { |
EXPECT_FALSE(adapter_->IsDiscovering()); |
} |
-TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscovery) { |
+TEST_F(BluetoothBlueZTest, SetDiscoveryFilterBeforeStartDiscovery) { |
// Test a simulated discovery session. |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -1400,16 +1398,14 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscovery) { |
df->AddUUID(BluetoothUUID("1000")); |
scoped_ptr<BluetoothDiscoveryFilter> discovery_filter(df); |
- adapter_->SetPowered(true, base::Bind(&BluetoothChromeOSTest::Callback, |
- base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ adapter_->SetPowered( |
+ true, base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
EXPECT_EQ(2, callback_count_); |
EXPECT_EQ(0, error_callback_count_); |
@@ -1430,9 +1426,8 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscovery) { |
EXPECT_NE(uuids.end(), std::find(uuids.begin(), uuids.end(), "1000")); |
discovery_sessions_[0]->Stop( |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -1450,7 +1445,7 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscovery) { |
EXPECT_EQ(nullptr, filter); |
} |
-TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryFail) { |
+TEST_F(BluetoothBlueZTest, SetDiscoveryFilterBeforeStartDiscoveryFail) { |
// Test a simulated discovery session. |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -1463,10 +1458,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryFail) { |
df->AddUUID(BluetoothUUID("1000")); |
scoped_ptr<BluetoothDiscoveryFilter> discovery_filter(df); |
- adapter_->SetPowered(true, base::Bind(&BluetoothChromeOSTest::Callback, |
- base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ adapter_->SetPowered( |
+ true, base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
EXPECT_EQ(1, callback_count_); |
callback_count_ = 0; |
@@ -1474,10 +1468,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryFail) { |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -1495,7 +1488,7 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryFail) { |
// This test queues two requests to StartDiscovery with pre set filter. This |
// should result in SetDiscoveryFilter, then StartDiscovery, and SetDiscovery |
// DBus calls |
-TEST_F(BluetoothChromeOSTest, QueuedSetDiscoveryFilterBeforeStartDiscovery) { |
+TEST_F(BluetoothBlueZTest, QueuedSetDiscoveryFilterBeforeStartDiscovery) { |
// Test a simulated discovery session. |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -1514,10 +1507,9 @@ TEST_F(BluetoothChromeOSTest, QueuedSetDiscoveryFilterBeforeStartDiscovery) { |
df2->AddUUID(BluetoothUUID("1002")); |
scoped_ptr<BluetoothDiscoveryFilter> discovery_filter2(df2); |
- adapter_->SetPowered(true, base::Bind(&BluetoothChromeOSTest::Callback, |
- base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ adapter_->SetPowered( |
+ true, base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
EXPECT_EQ(1, callback_count_); |
EXPECT_EQ(0, error_callback_count_); |
@@ -1526,17 +1518,15 @@ TEST_F(BluetoothChromeOSTest, QueuedSetDiscoveryFilterBeforeStartDiscovery) { |
// Queue two requests to start discovery session with filter. |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter2.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
// Run requests, on DBus level there should be call SetDiscoveryFilter, then |
// StartDiscovery, then SetDiscoveryFilter again. |
@@ -1565,14 +1555,12 @@ TEST_F(BluetoothChromeOSTest, QueuedSetDiscoveryFilterBeforeStartDiscovery) { |
EXPECT_NE(uuids.end(), std::find(uuids.begin(), uuids.end(), "1002")); |
discovery_sessions_[0]->Stop( |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
discovery_sessions_[1]->Stop( |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -1595,8 +1583,7 @@ TEST_F(BluetoothChromeOSTest, QueuedSetDiscoveryFilterBeforeStartDiscovery) { |
// Call StartFilteredDiscovery twice (2nd time while 1st call is still pending). |
// Make the first SetDiscoveryFilter fail and the second one succeed. It should |
// end up with one active discovery session. |
-TEST_F(BluetoothChromeOSTest, |
- QueuedSetDiscoveryFilterBeforeStartDiscoveryFail) { |
+TEST_F(BluetoothBlueZTest, QueuedSetDiscoveryFilterBeforeStartDiscoveryFail) { |
// Test a simulated discovery session. |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -1615,10 +1602,9 @@ TEST_F(BluetoothChromeOSTest, |
df2->AddUUID(BluetoothUUID("1002")); |
scoped_ptr<BluetoothDiscoveryFilter> discovery_filter2(df2); |
- adapter_->SetPowered(true, base::Bind(&BluetoothChromeOSTest::Callback, |
- base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ adapter_->SetPowered( |
+ true, base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
EXPECT_EQ(1, callback_count_); |
EXPECT_EQ(0, error_callback_count_); |
@@ -1629,17 +1615,15 @@ TEST_F(BluetoothChromeOSTest, |
// Queue two requests to start discovery session with filter. |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter2.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -1674,9 +1658,8 @@ TEST_F(BluetoothChromeOSTest, |
EXPECT_NE(uuids.end(), std::find(uuids.begin(), uuids.end(), "1002")); |
discovery_sessions_[0]->Stop( |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -1693,22 +1676,20 @@ TEST_F(BluetoothChromeOSTest, |
EXPECT_EQ(nullptr, filter); |
} |
-TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterAfterStartDiscovery) { |
+TEST_F(BluetoothBlueZTest, SetDiscoveryFilterAfterStartDiscovery) { |
// Test a simulated discovery session. |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
TestBluetoothAdapterObserver observer(adapter_); |
- adapter_->SetPowered(true, base::Bind(&BluetoothChromeOSTest::Callback, |
- base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ adapter_->SetPowered( |
+ true, base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
EXPECT_EQ(2, callback_count_); |
EXPECT_EQ(0, error_callback_count_); |
@@ -1736,9 +1717,8 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterAfterStartDiscovery) { |
discovery_sessions_[0]->SetDiscoveryFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
EXPECT_EQ(1, callback_count_); |
@@ -1756,9 +1736,8 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterAfterStartDiscovery) { |
EXPECT_NE(uuids.end(), std::find(uuids.begin(), uuids.end(), "1000")); |
discovery_sessions_[0]->Stop( |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -1778,12 +1757,11 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterAfterStartDiscovery) { |
// This unit test asserts that the basic reference counting, and filter merging |
// works correctly for discovery requests done via the BluetoothAdapter. |
-TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryMultiple) { |
+TEST_F(BluetoothBlueZTest, SetDiscoveryFilterBeforeStartDiscoveryMultiple) { |
GetAdapter(); |
- adapter_->SetPowered(true, base::Bind(&BluetoothChromeOSTest::Callback, |
- base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ adapter_->SetPowered( |
+ true, base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
EXPECT_EQ(1, callback_count_); |
EXPECT_EQ(0, error_callback_count_); |
EXPECT_TRUE(adapter_->IsPowered()); |
@@ -1818,10 +1796,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryMultiple) { |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -1868,9 +1845,8 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryMultiple) { |
// Request to stop discovery twice. |
for (int i = 0; i < 2; i++) { |
discovery_sessions_[i]->Stop( |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
if (i == 0) { |
@@ -1944,10 +1920,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryMultiple) { |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
// each result in 1 requests. |
message_loop_.Run(); |
@@ -1985,9 +1960,8 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryMultiple) { |
// Request to stop discovery 4 times. |
for (int i = 2; i < 6; i++) { |
discovery_sessions_[i]->Stop( |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
// filter no 2 is same as filter no 5, so removing it shouldn't cause any |
// filter update |
@@ -2014,12 +1988,11 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterBeforeStartDiscoveryMultiple) { |
// This unit test asserts that filter merging logic works correctly for filtered |
// discovery requests done via the BluetoothAdapter. |
-TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterMergingTest) { |
+TEST_F(BluetoothBlueZTest, SetDiscoveryFilterMergingTest) { |
GetAdapter(); |
- adapter_->SetPowered(true, base::Bind(&BluetoothChromeOSTest::Callback, |
- base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ adapter_->SetPowered( |
+ true, base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
BluetoothDiscoveryFilter* df = new BluetoothDiscoveryFilter( |
BluetoothDiscoveryFilter::Transport::TRANSPORT_LE); |
@@ -2029,10 +2002,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterMergingTest) { |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -2052,10 +2024,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterMergingTest) { |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -2077,10 +2048,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterMergingTest) { |
adapter_->StartDiscoverySessionWithFilter( |
discovery_filter3.Pass(), |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -2096,10 +2066,9 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterMergingTest) { |
// start additionally classic scan |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
message_loop_.Run(); |
@@ -2112,16 +2081,15 @@ TEST_F(BluetoothChromeOSTest, SetDiscoveryFilterMergingTest) { |
// Request to stop discovery 4 times. |
for (int i = 3; i >= 0; i--) { |
discovery_sessions_[i]->Stop( |
- base::Bind(&BluetoothChromeOSTest::Callback, base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCallback, |
- base::Unretained(this))); |
+ base::Bind(&BluetoothBlueZTest::Callback, base::Unretained(this)), |
+ base::Bind(&BluetoothBlueZTest::ErrorCallback, base::Unretained(this))); |
// Every session stopping would trigger filter update |
message_loop_.Run(); |
} |
} |
-TEST_F(BluetoothChromeOSTest, DeviceProperties) { |
+TEST_F(BluetoothBlueZTest, DeviceProperties) { |
GetAdapter(); |
BluetoothAdapter::DeviceList devices = adapter_->GetDevices(); |
@@ -2156,7 +2124,7 @@ TEST_F(BluetoothChromeOSTest, DeviceProperties) { |
EXPECT_EQ(0x0306, devices[idx]->GetDeviceID()); |
} |
-TEST_F(BluetoothChromeOSTest, DeviceClassChanged) { |
+TEST_F(BluetoothBlueZTest, DeviceClassChanged) { |
// Simulate a change of class of a device, as sometimes occurs |
// during discovery. |
GetAdapter(); |
@@ -2185,7 +2153,7 @@ TEST_F(BluetoothChromeOSTest, DeviceClassChanged) { |
EXPECT_EQ(BluetoothDevice::DEVICE_MOUSE, devices[idx]->GetDeviceType()); |
} |
-TEST_F(BluetoothChromeOSTest, DeviceNameChanged) { |
+TEST_F(BluetoothBlueZTest, DeviceNameChanged) { |
// Simulate a change of name of a device. |
GetAdapter(); |
@@ -2218,7 +2186,7 @@ TEST_F(BluetoothChromeOSTest, DeviceNameChanged) { |
EXPECT_EQ(base::UTF8ToUTF16(new_name), devices[idx]->GetName()); |
} |
-TEST_F(BluetoothChromeOSTest, DeviceAddressChanged) { |
+TEST_F(BluetoothBlueZTest, DeviceAddressChanged) { |
// Simulate a change of address of a device. |
GetAdapter(); |
@@ -2252,7 +2220,7 @@ TEST_F(BluetoothChromeOSTest, DeviceAddressChanged) { |
EXPECT_EQ(std::string(kNewAddress), devices[idx]->GetAddress()); |
} |
-TEST_F(BluetoothChromeOSTest, DeviceUuidsChanged) { |
+TEST_F(BluetoothBlueZTest, DeviceUuidsChanged) { |
// Simulate a change of advertised services of a device. |
GetAdapter(); |
@@ -2300,7 +2268,7 @@ TEST_F(BluetoothChromeOSTest, DeviceUuidsChanged) { |
EXPECT_EQ(uuids[4], BluetoothUUID("110a")); |
} |
-TEST_F(BluetoothChromeOSTest, DeviceInquiryRSSIInvalidated) { |
+TEST_F(BluetoothBlueZTest, DeviceInquiryRSSIInvalidated) { |
// Simulate invalidation of inquiry RSSI of a device, as it occurs |
// when discovery is finished. |
GetAdapter(); |
@@ -2337,7 +2305,7 @@ TEST_F(BluetoothChromeOSTest, DeviceInquiryRSSIInvalidated) { |
EXPECT_EQ(unknown_power, devices[idx]->GetInquiryRSSI()); |
} |
-TEST_F(BluetoothChromeOSTest, DeviceInquiryTxPowerInvalidated) { |
+TEST_F(BluetoothBlueZTest, DeviceInquiryTxPowerInvalidated) { |
// Simulate invalidation of inquiry TxPower of a device, as it occurs |
// when discovery is finished. |
GetAdapter(); |
@@ -2374,7 +2342,7 @@ TEST_F(BluetoothChromeOSTest, DeviceInquiryTxPowerInvalidated) { |
EXPECT_EQ(unknown_power, devices[idx]->GetInquiryTxPower()); |
} |
-TEST_F(BluetoothChromeOSTest, ForgetDevice) { |
+TEST_F(BluetoothBlueZTest, ForgetDevice) { |
GetAdapter(); |
BluetoothAdapter::DeviceList devices = adapter_->GetDevices(); |
@@ -2403,7 +2371,7 @@ TEST_F(BluetoothChromeOSTest, ForgetDevice) { |
ASSERT_EQ(1U, devices.size()); |
} |
-TEST_F(BluetoothChromeOSTest, ForgetUnpairedDevice) { |
+TEST_F(BluetoothBlueZTest, ForgetUnpairedDevice) { |
GetAdapter(); |
DiscoverDevices(); |
@@ -2414,7 +2382,7 @@ TEST_F(BluetoothChromeOSTest, ForgetUnpairedDevice) { |
// Connect the device so it becomes trusted and remembered. |
device->Connect(nullptr, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
ASSERT_EQ(1, callback_count_); |
@@ -2447,7 +2415,7 @@ TEST_F(BluetoothChromeOSTest, ForgetUnpairedDevice) { |
EXPECT_FALSE(device != nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, ConnectPairedDevice) { |
+TEST_F(BluetoothBlueZTest, ConnectPairedDevice) { |
GetAdapter(); |
BluetoothDevice* device = adapter_->GetDevice( |
@@ -2460,7 +2428,7 @@ TEST_F(BluetoothChromeOSTest, ConnectPairedDevice) { |
// Connect without a pairing delegate; since the device is already Paired |
// this should succeed and the device should become connected. |
device->Connect(nullptr, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, callback_count_); |
@@ -2475,7 +2443,7 @@ TEST_F(BluetoothChromeOSTest, ConnectPairedDevice) { |
EXPECT_FALSE(device->IsConnecting()); |
} |
-TEST_F(BluetoothChromeOSTest, ConnectUnpairableDevice) { |
+TEST_F(BluetoothBlueZTest, ConnectUnpairableDevice) { |
GetAdapter(); |
DiscoverDevices(); |
@@ -2489,7 +2457,7 @@ TEST_F(BluetoothChromeOSTest, ConnectUnpairableDevice) { |
// Connect without a pairing delegate; since the device does not require |
// pairing, this should succeed and the device should become connected. |
device->Connect(nullptr, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, callback_count_); |
@@ -2516,7 +2484,7 @@ TEST_F(BluetoothChromeOSTest, ConnectUnpairableDevice) { |
EXPECT_FALSE(device->IsConnectable()); |
} |
-TEST_F(BluetoothChromeOSTest, ConnectConnectedDevice) { |
+TEST_F(BluetoothBlueZTest, ConnectConnectedDevice) { |
GetAdapter(); |
BluetoothDevice* device = adapter_->GetDevice( |
@@ -2525,7 +2493,7 @@ TEST_F(BluetoothChromeOSTest, ConnectConnectedDevice) { |
ASSERT_TRUE(device->IsPaired()); |
device->Connect(nullptr, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
ASSERT_EQ(1, callback_count_); |
@@ -2539,7 +2507,7 @@ TEST_F(BluetoothChromeOSTest, ConnectConnectedDevice) { |
TestBluetoothAdapterObserver observer(adapter_); |
device->Connect(nullptr, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, callback_count_); |
@@ -2553,7 +2521,7 @@ TEST_F(BluetoothChromeOSTest, ConnectConnectedDevice) { |
EXPECT_FALSE(device->IsConnecting()); |
} |
-TEST_F(BluetoothChromeOSTest, ConnectDeviceFails) { |
+TEST_F(BluetoothBlueZTest, ConnectDeviceFails) { |
GetAdapter(); |
DiscoverDevices(); |
@@ -2567,7 +2535,7 @@ TEST_F(BluetoothChromeOSTest, ConnectDeviceFails) { |
// Connect without a pairing delegate; since the device requires pairing, |
// this should fail with an error. |
device->Connect(nullptr, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, callback_count_); |
@@ -2580,7 +2548,7 @@ TEST_F(BluetoothChromeOSTest, ConnectDeviceFails) { |
EXPECT_FALSE(device->IsConnecting()); |
} |
-TEST_F(BluetoothChromeOSTest, DisconnectDevice) { |
+TEST_F(BluetoothBlueZTest, DisconnectDevice) { |
GetAdapter(); |
BluetoothDevice* device = adapter_->GetDevice( |
@@ -2589,7 +2557,7 @@ TEST_F(BluetoothChromeOSTest, DisconnectDevice) { |
ASSERT_TRUE(device->IsPaired()); |
device->Connect(nullptr, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
ASSERT_EQ(1, callback_count_); |
@@ -2614,7 +2582,7 @@ TEST_F(BluetoothChromeOSTest, DisconnectDevice) { |
EXPECT_FALSE(device->IsConnected()); |
} |
-TEST_F(BluetoothChromeOSTest, DisconnectUnconnectedDevice) { |
+TEST_F(BluetoothBlueZTest, DisconnectUnconnectedDevice) { |
GetAdapter(); |
BluetoothDevice* device = adapter_->GetDevice( |
@@ -2637,7 +2605,7 @@ TEST_F(BluetoothChromeOSTest, DisconnectUnconnectedDevice) { |
EXPECT_FALSE(device->IsConnected()); |
} |
-TEST_F(BluetoothChromeOSTest, PairTrustedDevice) { |
+TEST_F(BluetoothBlueZTest, PairTrustedDevice) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -2667,7 +2635,7 @@ TEST_F(BluetoothChromeOSTest, PairTrustedDevice) { |
adapter_->AddPairingDelegate( |
&pairing_delegate, BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
device->Pair(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
EXPECT_EQ(1, pairing_delegate.confirm_passkey_count_); |
@@ -2685,7 +2653,7 @@ TEST_F(BluetoothChromeOSTest, PairTrustedDevice) { |
EXPECT_TRUE(properties->paired.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairAlreadyPairedDevice) { |
+TEST_F(BluetoothBlueZTest, PairAlreadyPairedDevice) { |
GetAdapter(); |
fake_bluetooth_device_client_->CreateDevice( |
@@ -2708,7 +2676,7 @@ TEST_F(BluetoothChromeOSTest, PairAlreadyPairedDevice) { |
adapter_->AddPairingDelegate( |
&pairing_delegate, BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
device->Pair(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
// For already paired devices a call to |Pair| should succeed without calling |
@@ -2718,7 +2686,7 @@ TEST_F(BluetoothChromeOSTest, PairAlreadyPairedDevice) { |
EXPECT_EQ(0, error_callback_count_); |
} |
-TEST_F(BluetoothChromeOSTest, PairLegacyAutopair) { |
+TEST_F(BluetoothBlueZTest, PairLegacyAutopair) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -2735,7 +2703,7 @@ TEST_F(BluetoothChromeOSTest, PairLegacyAutopair) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, pairing_delegate.call_count_); |
@@ -2770,7 +2738,7 @@ TEST_F(BluetoothChromeOSTest, PairLegacyAutopair) { |
EXPECT_TRUE(properties->trusted.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairDisplayPinCode) { |
+TEST_F(BluetoothBlueZTest, PairDisplayPinCode) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -2786,7 +2754,7 @@ TEST_F(BluetoothChromeOSTest, PairDisplayPinCode) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -2823,7 +2791,7 @@ TEST_F(BluetoothChromeOSTest, PairDisplayPinCode) { |
EXPECT_TRUE(properties->trusted.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairDisplayPasskey) { |
+TEST_F(BluetoothBlueZTest, PairDisplayPasskey) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -2840,7 +2808,7 @@ TEST_F(BluetoothChromeOSTest, PairDisplayPasskey) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
// One call for DisplayPasskey() and one for KeysEntered(). |
@@ -2898,7 +2866,7 @@ TEST_F(BluetoothChromeOSTest, PairDisplayPasskey) { |
EXPECT_TRUE(properties->trusted.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairRequestPinCode) { |
+TEST_F(BluetoothBlueZTest, PairRequestPinCode) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -2914,7 +2882,7 @@ TEST_F(BluetoothChromeOSTest, PairRequestPinCode) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -2952,7 +2920,7 @@ TEST_F(BluetoothChromeOSTest, PairRequestPinCode) { |
EXPECT_TRUE(properties->trusted.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairConfirmPasskey) { |
+TEST_F(BluetoothBlueZTest, PairConfirmPasskey) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -2968,7 +2936,7 @@ TEST_F(BluetoothChromeOSTest, PairConfirmPasskey) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3003,7 +2971,7 @@ TEST_F(BluetoothChromeOSTest, PairConfirmPasskey) { |
EXPECT_TRUE(properties->trusted.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairRequestPasskey) { |
+TEST_F(BluetoothBlueZTest, PairRequestPasskey) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3020,7 +2988,7 @@ TEST_F(BluetoothChromeOSTest, PairRequestPasskey) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3054,7 +3022,7 @@ TEST_F(BluetoothChromeOSTest, PairRequestPasskey) { |
EXPECT_TRUE(properties->trusted.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairJustWorks) { |
+TEST_F(BluetoothBlueZTest, PairJustWorks) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3071,7 +3039,7 @@ TEST_F(BluetoothChromeOSTest, PairJustWorks) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, pairing_delegate.call_count_); |
@@ -3101,7 +3069,7 @@ TEST_F(BluetoothChromeOSTest, PairJustWorks) { |
EXPECT_TRUE(properties->trusted.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairUnpairableDeviceFails) { |
+TEST_F(BluetoothBlueZTest, PairUnpairableDeviceFails) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3116,7 +3084,7 @@ TEST_F(BluetoothChromeOSTest, PairUnpairableDeviceFails) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, pairing_delegate.call_count_); |
@@ -3135,7 +3103,7 @@ TEST_F(BluetoothChromeOSTest, PairUnpairableDeviceFails) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingFails) { |
+TEST_F(BluetoothBlueZTest, PairingFails) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3151,7 +3119,7 @@ TEST_F(BluetoothChromeOSTest, PairingFails) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, pairing_delegate.call_count_); |
@@ -3170,7 +3138,7 @@ TEST_F(BluetoothChromeOSTest, PairingFails) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingFailsAtConnection) { |
+TEST_F(BluetoothBlueZTest, PairingFailsAtConnection) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3187,7 +3155,7 @@ TEST_F(BluetoothChromeOSTest, PairingFailsAtConnection) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, pairing_delegate.call_count_); |
@@ -3217,7 +3185,7 @@ TEST_F(BluetoothChromeOSTest, PairingFailsAtConnection) { |
EXPECT_TRUE(properties->trusted.value()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingRejectedAtPinCode) { |
+TEST_F(BluetoothBlueZTest, PairingRejectedAtPinCode) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3233,7 +3201,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtPinCode) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3255,7 +3223,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtPinCode) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingCancelledAtPinCode) { |
+TEST_F(BluetoothBlueZTest, PairingCancelledAtPinCode) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3271,7 +3239,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtPinCode) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3293,7 +3261,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtPinCode) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingRejectedAtPasskey) { |
+TEST_F(BluetoothBlueZTest, PairingRejectedAtPasskey) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3309,7 +3277,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtPasskey) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3331,7 +3299,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtPasskey) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingCancelledAtPasskey) { |
+TEST_F(BluetoothBlueZTest, PairingCancelledAtPasskey) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3347,7 +3315,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtPasskey) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3369,7 +3337,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtPasskey) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingRejectedAtConfirmation) { |
+TEST_F(BluetoothBlueZTest, PairingRejectedAtConfirmation) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3385,7 +3353,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtConfirmation) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3407,7 +3375,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtConfirmation) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingCancelledAtConfirmation) { |
+TEST_F(BluetoothBlueZTest, PairingCancelledAtConfirmation) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3423,7 +3391,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtConfirmation) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3445,7 +3413,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtConfirmation) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, PairingCancelledInFlight) { |
+TEST_F(BluetoothBlueZTest, PairingCancelledInFlight) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3461,7 +3429,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledInFlight) { |
TestPairingDelegate pairing_delegate; |
device->Connect(&pairing_delegate, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, pairing_delegate.call_count_); |
@@ -3482,15 +3450,14 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledInFlight) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCode) { |
+TEST_F(BluetoothBlueZTest, IncomingPairRequestPinCode) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
TestPairingDelegate pairing_delegate; |
adapter_->AddPairingDelegate( |
- &pairing_delegate, |
- BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
+ &pairing_delegate, BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
// Requires that we provide a PIN code. |
fake_bluetooth_device_client_->CreateDevice( |
@@ -3505,7 +3472,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCode) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPinCodePath), |
- true, GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3531,20 +3498,19 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCode) { |
ASSERT_TRUE(properties->trusted.value()); |
// No pairing context should remain on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskey) { |
+TEST_F(BluetoothBlueZTest, IncomingPairConfirmPasskey) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
TestPairingDelegate pairing_delegate; |
adapter_->AddPairingDelegate( |
- &pairing_delegate, |
- BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
+ &pairing_delegate, BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
// Requests that we confirm a displayed passkey. |
fake_bluetooth_device_client_->CreateDevice( |
@@ -3559,7 +3525,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskey) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kConfirmPasskeyPath), |
- true, GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3586,20 +3552,19 @@ TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskey) { |
ASSERT_TRUE(properties->trusted.value()); |
// No pairing context should remain on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskey) { |
+TEST_F(BluetoothBlueZTest, IncomingPairRequestPasskey) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
TestPairingDelegate pairing_delegate; |
adapter_->AddPairingDelegate( |
- &pairing_delegate, |
- BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
+ &pairing_delegate, BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
// Requests that we provide a Passkey. |
fake_bluetooth_device_client_->CreateDevice( |
@@ -3614,7 +3579,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskey) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPasskeyPath), |
- true, GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3640,20 +3605,19 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskey) { |
ASSERT_TRUE(properties->trusted.value()); |
// No pairing context should remain on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, IncomingPairJustWorks) { |
+TEST_F(BluetoothBlueZTest, IncomingPairJustWorks) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
TestPairingDelegate pairing_delegate; |
adapter_->AddPairingDelegate( |
- &pairing_delegate, |
- BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
+ &pairing_delegate, BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
// Uses just-works pairing so, sinec this an incoming pairing, require |
// authorization from the user. |
@@ -3669,7 +3633,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairJustWorks) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kJustWorksPath), true, |
- GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
@@ -3695,12 +3659,12 @@ TEST_F(BluetoothChromeOSTest, IncomingPairJustWorks) { |
ASSERT_TRUE(properties->trusted.value()); |
// No pairing context should remain on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCodeWithoutDelegate) { |
+TEST_F(BluetoothBlueZTest, IncomingPairRequestPinCodeWithoutDelegate) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3719,7 +3683,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCodeWithoutDelegate) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPinCodePath), |
- true, GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
message_loop_.Run(); |
@@ -3734,12 +3698,12 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPinCodeWithoutDelegate) { |
EXPECT_FALSE(device->IsPaired()); |
// No pairing context should remain on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskeyWithoutDelegate) { |
+TEST_F(BluetoothBlueZTest, IncomingPairConfirmPasskeyWithoutDelegate) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3758,7 +3722,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskeyWithoutDelegate) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kConfirmPasskeyPath), |
- true, GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
message_loop_.Run(); |
@@ -3773,12 +3737,12 @@ TEST_F(BluetoothChromeOSTest, IncomingPairConfirmPasskeyWithoutDelegate) { |
EXPECT_FALSE(device->IsPaired()); |
// No pairing context should remain on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskeyWithoutDelegate) { |
+TEST_F(BluetoothBlueZTest, IncomingPairRequestPasskeyWithoutDelegate) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3797,7 +3761,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskeyWithoutDelegate) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPasskeyPath), |
- true, GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
message_loop_.Run(); |
@@ -3812,12 +3776,12 @@ TEST_F(BluetoothChromeOSTest, IncomingPairRequestPasskeyWithoutDelegate) { |
EXPECT_FALSE(device->IsPaired()); |
// No pairing context should remain on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, IncomingPairJustWorksWithoutDelegate) { |
+TEST_F(BluetoothBlueZTest, IncomingPairJustWorksWithoutDelegate) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
@@ -3836,7 +3800,7 @@ TEST_F(BluetoothChromeOSTest, IncomingPairJustWorksWithoutDelegate) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kJustWorksPath), true, |
- GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
message_loop_.Run(); |
@@ -3851,20 +3815,19 @@ TEST_F(BluetoothChromeOSTest, IncomingPairJustWorksWithoutDelegate) { |
EXPECT_FALSE(device->IsPaired()); |
// No pairing context should remain on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
} |
-TEST_F(BluetoothChromeOSTest, RemovePairingDelegateDuringPairing) { |
+TEST_F(BluetoothBlueZTest, RemovePairingDelegateDuringPairing) { |
fake_bluetooth_device_client_->SetSimulationIntervalMs(10); |
GetAdapter(); |
TestPairingDelegate pairing_delegate; |
adapter_->AddPairingDelegate( |
- &pairing_delegate, |
- BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
+ &pairing_delegate, BluetoothAdapter::PAIRING_DELEGATE_PRIORITY_HIGH); |
// Requests that we provide a Passkey. |
fake_bluetooth_device_client_->CreateDevice( |
@@ -3879,21 +3842,21 @@ TEST_F(BluetoothChromeOSTest, RemovePairingDelegateDuringPairing) { |
fake_bluetooth_device_client_->SimulatePairing( |
dbus::ObjectPath(bluez::FakeBluetoothDeviceClient::kRequestPasskeyPath), |
- true, GetCallback(), base::Bind(&BluetoothChromeOSTest::DBusErrorCallback, |
+ true, GetCallback(), base::Bind(&BluetoothBlueZTest::DBusErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(1, pairing_delegate.call_count_); |
EXPECT_EQ(1, pairing_delegate.request_passkey_count_); |
// A pairing context should now be set on the device. |
- BluetoothDeviceChromeOS* device_chromeos = |
- static_cast<BluetoothDeviceChromeOS*>(device); |
- ASSERT_TRUE(device_chromeos->GetPairing() != nullptr); |
+ BluetoothDeviceBlueZ* device_bluez = |
+ static_cast<BluetoothDeviceBlueZ*>(device); |
+ ASSERT_TRUE(device_bluez->GetPairing() != nullptr); |
// Removing the pairing delegate should remove that pairing context. |
adapter_->RemovePairingDelegate(&pairing_delegate); |
- EXPECT_TRUE(device_chromeos->GetPairing() == nullptr); |
+ EXPECT_TRUE(device_bluez->GetPairing() == nullptr); |
// Set the Passkey, this should now have no effect since the pairing has |
// been, in-effect, cancelled |
@@ -3906,7 +3869,7 @@ TEST_F(BluetoothChromeOSTest, RemovePairingDelegateDuringPairing) { |
EXPECT_FALSE(device->IsPaired()); |
} |
-TEST_F(BluetoothChromeOSTest, DeviceId) { |
+TEST_F(BluetoothBlueZTest, DeviceId) { |
GetAdapter(); |
// Use the built-in paired device for this test, grab its Properties |
@@ -3961,7 +3924,7 @@ TEST_F(BluetoothChromeOSTest, DeviceId) { |
EXPECT_EQ(0, device->GetDeviceID()); |
} |
-TEST_F(BluetoothChromeOSTest, GetConnectionInfoForDisconnectedDevice) { |
+TEST_F(BluetoothBlueZTest, GetConnectionInfoForDisconnectedDevice) { |
GetAdapter(); |
BluetoothDevice* device = adapter_->GetDevice( |
bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress); |
@@ -3977,13 +3940,13 @@ TEST_F(BluetoothChromeOSTest, GetConnectionInfoForDisconnectedDevice) { |
EXPECT_EQ(unknown_power, conn_info.max_transmit_power); |
} |
-TEST_F(BluetoothChromeOSTest, GetConnectionInfoForConnectedDevice) { |
+TEST_F(BluetoothBlueZTest, GetConnectionInfoForConnectedDevice) { |
GetAdapter(); |
BluetoothDevice* device = adapter_->GetDevice( |
bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress); |
device->Connect(nullptr, GetCallback(), |
- base::Bind(&BluetoothChromeOSTest::ConnectErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::ConnectErrorCallback, |
base::Unretained(this))); |
EXPECT_TRUE(device->IsConnected()); |
@@ -3998,13 +3961,13 @@ TEST_F(BluetoothChromeOSTest, GetConnectionInfoForConnectedDevice) { |
} |
// Verifies Shutdown shuts down the adapter as expected. |
-TEST_F(BluetoothChromeOSTest, Shutdown) { |
+TEST_F(BluetoothBlueZTest, Shutdown) { |
// Set up adapter. Set powered & discoverable, start discovery. |
GetAdapter(); |
adapter_->SetPowered(true, GetCallback(), GetErrorCallback()); |
adapter_->SetDiscoverable(true, GetCallback(), GetErrorCallback()); |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
base::MessageLoop::current()->Run(); |
@@ -4028,13 +3991,13 @@ TEST_F(BluetoothChromeOSTest, Shutdown) { |
EXPECT_NE(nullptr, |
adapter_->GetDevice( |
bluez::FakeBluetoothDeviceClient::kPairedDeviceAddress)); |
- EXPECT_NE(dbus::ObjectPath(""), static_cast<BluetoothAdapterChromeOS*>( |
- adapter_.get())->object_path()); |
+ EXPECT_NE(dbus::ObjectPath(""), |
+ static_cast<BluetoothAdapterBlueZ*>(adapter_.get())->object_path()); |
// Shutdown |
adapter_->Shutdown(); |
- // Validate post shutdown state by calling all BluetoothAdapterChromeOS |
+ // Validate post shutdown state by calling all BluetoothAdapterBlueZ |
// members, in declaration order: |
adapter_->Shutdown(); |
@@ -4070,15 +4033,15 @@ TEST_F(BluetoothChromeOSTest, Shutdown) { |
BluetoothAudioSink::Options audio_sink_options; |
adapter_->RegisterAudioSink( |
audio_sink_options, |
- base::Bind(&BluetoothChromeOSTest::AudioSinkAcquiredCallback, |
+ base::Bind(&BluetoothBlueZTest::AudioSinkAcquiredCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::AudioSinkErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::AudioSinkErrorCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, callback_count_); |
EXPECT_EQ(1, error_callback_count_--) << "RegisterAudioSink error"; |
- BluetoothAdapterChromeOS* adapter_chrome_os = |
- static_cast<BluetoothAdapterChromeOS*>(adapter_.get()); |
+ BluetoothAdapterBlueZ* adapter_chrome_os = |
ortuno
2015/11/06 18:15:42
This should probably be renamed to "adapter" or "a
rkc
2015/11/25 00:48:16
Done.
|
+ static_cast<BluetoothAdapterBlueZ*>(adapter_.get()); |
EXPECT_EQ(nullptr, |
adapter_chrome_os->GetDeviceWithPath(dbus::ObjectPath(""))); |
@@ -4105,9 +4068,9 @@ TEST_F(BluetoothChromeOSTest, Shutdown) { |
adapter_chrome_os->UseProfile( |
BluetoothUUID(), dbus::ObjectPath(""), |
bluez::BluetoothProfileManagerClient::Options(), &profile_delegate, |
- base::Bind(&BluetoothChromeOSTest::ProfileRegisteredCallback, |
+ base::Bind(&BluetoothBlueZTest::ProfileRegisteredCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCompletionCallback, |
+ base::Bind(&BluetoothBlueZTest::ErrorCompletionCallback, |
base::Unretained(this))); |
EXPECT_FALSE(adapter_profile_) << "UseProfile error"; |
@@ -4135,9 +4098,9 @@ TEST_F(BluetoothChromeOSTest, Shutdown) { |
adapter_chrome_os->OnRequestDefaultAgentError("", ""); |
adapter_chrome_os->OnRegisterAudioSink( |
- base::Bind(&BluetoothChromeOSTest::AudioSinkAcquiredCallback, |
+ base::Bind(&BluetoothBlueZTest::AudioSinkAcquiredCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::AudioSinkErrorCallback, |
+ base::Bind(&BluetoothBlueZTest::AudioSinkErrorCallback, |
base::Unretained(this)), |
scoped_refptr<device::BluetoothAudioSink>()); |
EXPECT_EQ(0, callback_count_); |
@@ -4183,9 +4146,9 @@ TEST_F(BluetoothChromeOSTest, Shutdown) { |
adapter_chrome_os->UseProfile( |
BluetoothUUID(), dbus::ObjectPath(""), |
bluez::BluetoothProfileManagerClient::Options(), &profile_delegate, |
- base::Bind(&BluetoothChromeOSTest::ProfileRegisteredCallback, |
+ base::Bind(&BluetoothBlueZTest::ProfileRegisteredCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCompletionCallback, |
+ base::Bind(&BluetoothBlueZTest::ErrorCompletionCallback, |
base::Unretained(this))); |
EXPECT_FALSE(adapter_profile_) << "UseProfile error"; |
@@ -4194,9 +4157,9 @@ TEST_F(BluetoothChromeOSTest, Shutdown) { |
adapter_chrome_os->SetProfileDelegate( |
BluetoothUUID(), dbus::ObjectPath(""), &profile_delegate, |
- base::Bind(&BluetoothChromeOSTest::ProfileRegisteredCallback, |
+ base::Bind(&BluetoothBlueZTest::ProfileRegisteredCallback, |
base::Unretained(this)), |
- base::Bind(&BluetoothChromeOSTest::ErrorCompletionCallback, |
+ base::Bind(&BluetoothBlueZTest::ErrorCompletionCallback, |
base::Unretained(this))); |
EXPECT_EQ(0, callback_count_) << "SetProfileDelegate error"; |
EXPECT_EQ(1, error_callback_count_--) << "SetProfileDelegate error"; |
@@ -4210,7 +4173,7 @@ TEST_F(BluetoothChromeOSTest, Shutdown) { |
// From BluetoothAdapater: |
adapter_->StartDiscoverySession( |
- base::Bind(&BluetoothChromeOSTest::DiscoverySessionCallback, |
+ base::Bind(&BluetoothBlueZTest::DiscoverySessionCallback, |
base::Unretained(this)), |
GetErrorCallback()); |
EXPECT_EQ(0, callback_count_) << "StartDiscoverySession error"; |
@@ -4227,11 +4190,11 @@ TEST_F(BluetoothChromeOSTest, Shutdown) { |
} |
// Verifies post-Shutdown of discovery sessions and OnStartDiscovery. |
-TEST_F(BluetoothChromeOSTest, Shutdown_OnStartDiscovery) { |
+TEST_F(BluetoothBlueZTest, Shutdown_OnStartDiscovery) { |
const int kNumberOfDiscoverySessions = 10; |
GetAdapter(); |
- BluetoothAdapterChromeOS* adapter_chrome_os = |
- static_cast<BluetoothAdapterChromeOS*>(adapter_.get()); |
+ BluetoothAdapterBlueZ* adapter_chrome_os = |
+ static_cast<BluetoothAdapterBlueZ*>(adapter_.get()); |
for (int i = 0; i < kNumberOfDiscoverySessions; i++) { |
adapter_chrome_os->AddDiscoverySession(nullptr, GetCallback(), |
@@ -4246,11 +4209,11 @@ TEST_F(BluetoothChromeOSTest, Shutdown_OnStartDiscovery) { |
} |
// Verifies post-Shutdown of discovery sessions and OnStartDiscoveryError. |
-TEST_F(BluetoothChromeOSTest, Shutdown_OnStartDiscoveryError) { |
+TEST_F(BluetoothBlueZTest, Shutdown_OnStartDiscoveryError) { |
const int kNumberOfDiscoverySessions = 10; |
GetAdapter(); |
- BluetoothAdapterChromeOS* adapter_chrome_os = |
- static_cast<BluetoothAdapterChromeOS*>(adapter_.get()); |
+ BluetoothAdapterBlueZ* adapter_chrome_os = |
+ static_cast<BluetoothAdapterBlueZ*>(adapter_.get()); |
for (int i = 0; i < kNumberOfDiscoverySessions; i++) { |
adapter_chrome_os->AddDiscoverySession(nullptr, GetCallback(), |
@@ -4265,11 +4228,11 @@ TEST_F(BluetoothChromeOSTest, Shutdown_OnStartDiscoveryError) { |
} |
// Verifies post-Shutdown of discovery sessions and OnStartDiscovery. |
-TEST_F(BluetoothChromeOSTest, Shutdown_OnStopDiscovery) { |
+TEST_F(BluetoothBlueZTest, Shutdown_OnStopDiscovery) { |
const int kNumberOfDiscoverySessions = 10; |
GetAdapter(); |
- BluetoothAdapterChromeOS* adapter_chrome_os = |
- static_cast<BluetoothAdapterChromeOS*>(adapter_.get()); |
+ BluetoothAdapterBlueZ* adapter_chrome_os = |
+ static_cast<BluetoothAdapterBlueZ*>(adapter_.get()); |
// In order to queue up discovery sessions before an OnStopDiscovery call |
// RemoveDiscoverySession must be called, so Add, Start, and Remove: |
@@ -4296,11 +4259,11 @@ TEST_F(BluetoothChromeOSTest, Shutdown_OnStopDiscovery) { |
} |
// Verifies post-Shutdown of discovery sessions and OnStopDiscoveryError. |
-TEST_F(BluetoothChromeOSTest, Shutdown_OnStopDiscoveryError) { |
+TEST_F(BluetoothBlueZTest, Shutdown_OnStopDiscoveryError) { |
const int kNumberOfDiscoverySessions = 10; |
GetAdapter(); |
- BluetoothAdapterChromeOS* adapter_chrome_os = |
- static_cast<BluetoothAdapterChromeOS*>(adapter_.get()); |
+ BluetoothAdapterBlueZ* adapter_chrome_os = |
+ static_cast<BluetoothAdapterBlueZ*>(adapter_.get()); |
// In order to queue up discovery sessions before an OnStopDiscoveryError call |
// RemoveDiscoverySession must be called, so Add, Start, and Remove: |
@@ -4326,4 +4289,4 @@ TEST_F(BluetoothChromeOSTest, Shutdown_OnStopDiscoveryError) { |
EXPECT_EQ(1 + kNumberOfDiscoverySessions, error_callback_count_); |
} |
-} // namespace chromeos |
+} // namespace bluez |