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_bluez_unittest.cc

Issue 1367663002: Add Linux support for the Bluetooth API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_dbus
Patch Set: Created 5 years, 3 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_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 4143b1abee87bb6375cdddebc55b5196f0a4fb05..f43c4e5b4f4ed7496afe0da6a408ba8b978fb4cf 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 {
@@ -151,7 +151,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 =
@@ -187,9 +187,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;
@@ -210,7 +209,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(
@@ -225,7 +224,7 @@ class BluetoothChromeOSTest : public testing::Test {
QuitMessageLoop();
}
- void ProfileRegisteredCallback(BluetoothAdapterProfileChromeOS* profile) {
+ void ProfileRegisteredCallback(BluetoothAdapterProfileBlueZ* profile) {
adapter_profile_ = profile;
++callback_count_;
QuitMessageLoop();
@@ -241,13 +240,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));
}
@@ -275,7 +274,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());
}
@@ -294,7 +293,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();
@@ -338,7 +337,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;
@@ -351,7 +350,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;
@@ -371,7 +370,7 @@ TEST_F(BluetoothChromeOSTest, AlreadyPresent) {
devices[1]->GetAddress());
}
-TEST_F(BluetoothChromeOSTest, BecomePresent) {
+TEST_F(BluetoothBlueZTest, BecomePresent) {
fake_bluetooth_adapter_client_->SetVisible(false);
GetAdapter();
ASSERT_FALSE(adapter_->IsPresent());
@@ -399,7 +398,7 @@ TEST_F(BluetoothChromeOSTest, BecomePresent) {
EXPECT_FALSE(adapter_->IsDiscovering());
}
-TEST_F(BluetoothChromeOSTest, BecomeNotPresent) {
+TEST_F(BluetoothBlueZTest, BecomeNotPresent) {
GetAdapter();
ASSERT_TRUE(adapter_->IsPresent());
@@ -426,7 +425,7 @@ TEST_F(BluetoothChromeOSTest, BecomeNotPresent) {
EXPECT_FALSE(adapter_->IsDiscovering());
}
-TEST_F(BluetoothChromeOSTest, SecondAdapter) {
+TEST_F(BluetoothBlueZTest, SecondAdapter) {
GetAdapter();
ASSERT_TRUE(adapter_->IsPresent());
@@ -472,7 +471,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());
@@ -490,7 +489,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_);
@@ -513,7 +512,7 @@ TEST_F(BluetoothChromeOSTest, BecomeNotPowered) {
EXPECT_FALSE(adapter_->IsPowered());
}
-TEST_F(BluetoothChromeOSTest, SetPoweredWhenNotPresent) {
+TEST_F(BluetoothBlueZTest, SetPoweredWhenNotPresent) {
GetAdapter();
ASSERT_TRUE(adapter_->IsPresent());
@@ -539,7 +538,7 @@ TEST_F(BluetoothChromeOSTest, SetPoweredWhenNotPresent) {
EXPECT_FALSE(adapter_->IsPowered());
}
-TEST_F(BluetoothChromeOSTest, ChangeAdapterName) {
+TEST_F(BluetoothBlueZTest, ChangeAdapterName) {
GetAdapter();
static const std::string new_name(".__.");
@@ -551,7 +550,7 @@ TEST_F(BluetoothChromeOSTest, ChangeAdapterName) {
EXPECT_EQ(new_name, adapter_->GetName());
}
-TEST_F(BluetoothChromeOSTest, ChangeAdapterNameWhenNotPresent) {
+TEST_F(BluetoothBlueZTest, ChangeAdapterNameWhenNotPresent) {
GetAdapter();
ASSERT_TRUE(adapter_->IsPresent());
@@ -574,7 +573,7 @@ TEST_F(BluetoothChromeOSTest, ChangeAdapterNameWhenNotPresent) {
EXPECT_EQ("", adapter_->GetName());
}
-TEST_F(BluetoothChromeOSTest, BecomeDiscoverable) {
+TEST_F(BluetoothBlueZTest, BecomeDiscoverable) {
GetAdapter();
ASSERT_FALSE(adapter_->IsDiscoverable());
@@ -591,7 +590,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_);
@@ -613,7 +612,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());
@@ -639,12 +638,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();
@@ -678,7 +677,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();
@@ -698,7 +697,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();
@@ -707,7 +706,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();
@@ -740,11 +739,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();
@@ -806,7 +805,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_);
@@ -823,7 +822,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());
}
@@ -861,7 +860,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());
}
@@ -910,8 +909,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_);
@@ -928,7 +926,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());
}
@@ -965,7 +963,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());
@@ -982,7 +980,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());
}
@@ -1030,7 +1028,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.
@@ -1054,7 +1052,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.
@@ -1071,7 +1069,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());
@@ -1092,7 +1090,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_);
@@ -1109,7 +1107,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());
}
@@ -1149,7 +1147,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());
@@ -1160,7 +1158,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());
@@ -1177,7 +1175,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_);
@@ -1196,7 +1194,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());
}
@@ -1242,7 +1240,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_);
@@ -1274,7 +1272,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());
@@ -1292,7 +1290,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();
@@ -1308,7 +1306,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();
@@ -1322,7 +1320,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();
@@ -1360,7 +1358,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();
@@ -1373,16 +1371,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_);
@@ -1403,9 +1399,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();
@@ -1423,7 +1418,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();
@@ -1436,10 +1431,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;
@@ -1447,10 +1441,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();
@@ -1468,7 +1461,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();
@@ -1487,10 +1480,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_);
@@ -1499,17 +1491,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.
@@ -1538,14 +1528,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();
@@ -1568,8 +1556,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();
@@ -1588,10 +1575,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_);
@@ -1602,17 +1588,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();
@@ -1647,9 +1631,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();
@@ -1666,22 +1649,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_);
@@ -1709,9 +1690,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_);
@@ -1729,9 +1709,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();
@@ -1751,12 +1730,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());
@@ -1791,10 +1769,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();
@@ -1841,9 +1818,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) {
@@ -1917,10 +1893,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();
@@ -1958,9 +1933,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
@@ -1987,12 +1961,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);
@@ -2002,10 +1975,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();
@@ -2025,10 +1997,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();
@@ -2050,10 +2021,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();
@@ -2069,10 +2039,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();
@@ -2085,16 +2054,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();
@@ -2125,7 +2093,7 @@ TEST_F(BluetoothChromeOSTest, DeviceProperties) {
EXPECT_EQ(0x0306, devices[0]->GetDeviceID());
}
-TEST_F(BluetoothChromeOSTest, DeviceClassChanged) {
+TEST_F(BluetoothBlueZTest, DeviceClassChanged) {
// Simulate a change of class of a device, as sometimes occurs
// during discovery.
GetAdapter();
@@ -2152,7 +2120,7 @@ TEST_F(BluetoothChromeOSTest, DeviceClassChanged) {
EXPECT_EQ(BluetoothDevice::DEVICE_MOUSE, devices[0]->GetDeviceType());
}
-TEST_F(BluetoothChromeOSTest, DeviceNameChanged) {
+TEST_F(BluetoothBlueZTest, DeviceNameChanged) {
// Simulate a change of name of a device.
GetAdapter();
@@ -2181,7 +2149,7 @@ TEST_F(BluetoothChromeOSTest, DeviceNameChanged) {
EXPECT_EQ(base::UTF8ToUTF16(new_name), devices[0]->GetName());
}
-TEST_F(BluetoothChromeOSTest, DeviceUuidsChanged) {
+TEST_F(BluetoothBlueZTest, DeviceUuidsChanged) {
// Simulate a change of advertised services of a device.
GetAdapter();
@@ -2225,7 +2193,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();
@@ -2260,7 +2228,7 @@ TEST_F(BluetoothChromeOSTest, DeviceInquiryRSSIInvalidated) {
EXPECT_EQ(unknown_power, devices[0]->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();
@@ -2295,7 +2263,7 @@ TEST_F(BluetoothChromeOSTest, DeviceInquiryTxPowerInvalidated) {
EXPECT_EQ(unknown_power, devices[0]->GetInquiryTxPower());
}
-TEST_F(BluetoothChromeOSTest, ForgetDevice) {
+TEST_F(BluetoothBlueZTest, ForgetDevice) {
GetAdapter();
BluetoothAdapter::DeviceList devices = adapter_->GetDevices();
@@ -2320,7 +2288,7 @@ TEST_F(BluetoothChromeOSTest, ForgetDevice) {
ASSERT_EQ(1U, devices.size());
}
-TEST_F(BluetoothChromeOSTest, ForgetUnpairedDevice) {
+TEST_F(BluetoothBlueZTest, ForgetUnpairedDevice) {
GetAdapter();
DiscoverDevices();
@@ -2331,7 +2299,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_);
@@ -2364,7 +2332,7 @@ TEST_F(BluetoothChromeOSTest, ForgetUnpairedDevice) {
EXPECT_FALSE(device != nullptr);
}
-TEST_F(BluetoothChromeOSTest, ConnectPairedDevice) {
+TEST_F(BluetoothBlueZTest, ConnectPairedDevice) {
GetAdapter();
BluetoothDevice* device = adapter_->GetDevice(
@@ -2377,7 +2345,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_);
@@ -2392,7 +2360,7 @@ TEST_F(BluetoothChromeOSTest, ConnectPairedDevice) {
EXPECT_FALSE(device->IsConnecting());
}
-TEST_F(BluetoothChromeOSTest, ConnectUnpairableDevice) {
+TEST_F(BluetoothBlueZTest, ConnectUnpairableDevice) {
GetAdapter();
DiscoverDevices();
@@ -2406,7 +2374,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_);
@@ -2433,7 +2401,7 @@ TEST_F(BluetoothChromeOSTest, ConnectUnpairableDevice) {
EXPECT_FALSE(device->IsConnectable());
}
-TEST_F(BluetoothChromeOSTest, ConnectConnectedDevice) {
+TEST_F(BluetoothBlueZTest, ConnectConnectedDevice) {
GetAdapter();
BluetoothDevice* device = adapter_->GetDevice(
@@ -2442,7 +2410,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_);
@@ -2456,7 +2424,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_);
@@ -2470,7 +2438,7 @@ TEST_F(BluetoothChromeOSTest, ConnectConnectedDevice) {
EXPECT_FALSE(device->IsConnecting());
}
-TEST_F(BluetoothChromeOSTest, ConnectDeviceFails) {
+TEST_F(BluetoothBlueZTest, ConnectDeviceFails) {
GetAdapter();
DiscoverDevices();
@@ -2484,7 +2452,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_);
@@ -2497,7 +2465,7 @@ TEST_F(BluetoothChromeOSTest, ConnectDeviceFails) {
EXPECT_FALSE(device->IsConnecting());
}
-TEST_F(BluetoothChromeOSTest, DisconnectDevice) {
+TEST_F(BluetoothBlueZTest, DisconnectDevice) {
GetAdapter();
BluetoothDevice* device = adapter_->GetDevice(
@@ -2506,7 +2474,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_);
@@ -2531,7 +2499,7 @@ TEST_F(BluetoothChromeOSTest, DisconnectDevice) {
EXPECT_FALSE(device->IsConnected());
}
-TEST_F(BluetoothChromeOSTest, DisconnectUnconnectedDevice) {
+TEST_F(BluetoothBlueZTest, DisconnectUnconnectedDevice) {
GetAdapter();
BluetoothDevice* device = adapter_->GetDevice(
@@ -2554,7 +2522,7 @@ TEST_F(BluetoothChromeOSTest, DisconnectUnconnectedDevice) {
EXPECT_FALSE(device->IsConnected());
}
-TEST_F(BluetoothChromeOSTest, PairLegacyAutopair) {
+TEST_F(BluetoothBlueZTest, PairLegacyAutopair) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -2571,7 +2539,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_);
@@ -2606,7 +2574,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();
@@ -2622,7 +2590,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_);
@@ -2659,7 +2627,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();
@@ -2676,7 +2644,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().
@@ -2734,7 +2702,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();
@@ -2750,7 +2718,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_);
@@ -2788,7 +2756,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();
@@ -2804,7 +2772,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_);
@@ -2839,7 +2807,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();
@@ -2856,7 +2824,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_);
@@ -2890,7 +2858,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();
@@ -2907,7 +2875,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_);
@@ -2937,7 +2905,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();
@@ -2952,7 +2920,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_);
@@ -2971,7 +2939,7 @@ TEST_F(BluetoothChromeOSTest, PairUnpairableDeviceFails) {
EXPECT_FALSE(device->IsPaired());
}
-TEST_F(BluetoothChromeOSTest, PairingFails) {
+TEST_F(BluetoothBlueZTest, PairingFails) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -2987,7 +2955,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_);
@@ -3006,7 +2974,7 @@ TEST_F(BluetoothChromeOSTest, PairingFails) {
EXPECT_FALSE(device->IsPaired());
}
-TEST_F(BluetoothChromeOSTest, PairingFailsAtConnection) {
+TEST_F(BluetoothBlueZTest, PairingFailsAtConnection) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -3023,7 +2991,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_);
@@ -3053,7 +3021,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();
@@ -3069,7 +3037,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_);
@@ -3091,7 +3059,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtPinCode) {
EXPECT_FALSE(device->IsPaired());
}
-TEST_F(BluetoothChromeOSTest, PairingCancelledAtPinCode) {
+TEST_F(BluetoothBlueZTest, PairingCancelledAtPinCode) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -3107,7 +3075,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_);
@@ -3129,7 +3097,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtPinCode) {
EXPECT_FALSE(device->IsPaired());
}
-TEST_F(BluetoothChromeOSTest, PairingRejectedAtPasskey) {
+TEST_F(BluetoothBlueZTest, PairingRejectedAtPasskey) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -3145,7 +3113,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_);
@@ -3167,7 +3135,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtPasskey) {
EXPECT_FALSE(device->IsPaired());
}
-TEST_F(BluetoothChromeOSTest, PairingCancelledAtPasskey) {
+TEST_F(BluetoothBlueZTest, PairingCancelledAtPasskey) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -3183,7 +3151,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_);
@@ -3205,7 +3173,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtPasskey) {
EXPECT_FALSE(device->IsPaired());
}
-TEST_F(BluetoothChromeOSTest, PairingRejectedAtConfirmation) {
+TEST_F(BluetoothBlueZTest, PairingRejectedAtConfirmation) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -3221,7 +3189,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_);
@@ -3243,7 +3211,7 @@ TEST_F(BluetoothChromeOSTest, PairingRejectedAtConfirmation) {
EXPECT_FALSE(device->IsPaired());
}
-TEST_F(BluetoothChromeOSTest, PairingCancelledAtConfirmation) {
+TEST_F(BluetoothBlueZTest, PairingCancelledAtConfirmation) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -3259,7 +3227,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_);
@@ -3281,7 +3249,7 @@ TEST_F(BluetoothChromeOSTest, PairingCancelledAtConfirmation) {
EXPECT_FALSE(device->IsPaired());
}
-TEST_F(BluetoothChromeOSTest, PairingCancelledInFlight) {
+TEST_F(BluetoothBlueZTest, PairingCancelledInFlight) {
fake_bluetooth_device_client_->SetSimulationIntervalMs(10);
GetAdapter();
@@ -3297,7 +3265,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_);
@@ -3318,15 +3286,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(
@@ -3341,7 +3308,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_);
@@ -3367,20 +3334,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(
@@ -3395,7 +3361,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_);
@@ -3422,20 +3388,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(
@@ -3450,7 +3415,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_);
@@ -3476,20 +3441,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.
@@ -3505,7 +3469,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_);
@@ -3531,12 +3495,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();
@@ -3555,7 +3519,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();
@@ -3570,12 +3534,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();
@@ -3594,7 +3558,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();
@@ -3609,12 +3573,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();
@@ -3633,7 +3597,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();
@@ -3648,12 +3612,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();
@@ -3672,7 +3636,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();
@@ -3687,20 +3651,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(
@@ -3715,21 +3678,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
@@ -3742,7 +3705,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
@@ -3797,7 +3760,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);
@@ -3813,13 +3776,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());
@@ -3834,13 +3797,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();
@@ -3864,13 +3827,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();
@@ -3906,15 +3869,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 =
+ static_cast<BluetoothAdapterBlueZ*>(adapter_.get());
EXPECT_EQ(nullptr,
adapter_chrome_os->GetDeviceWithPath(dbus::ObjectPath("")));
@@ -3941,9 +3904,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";
@@ -3971,9 +3934,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_);
@@ -4019,9 +3982,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";
@@ -4030,9 +3993,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";
@@ -4046,7 +4009,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";
@@ -4063,11 +4026,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(),
@@ -4082,11 +4045,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(),
@@ -4101,11 +4064,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:
@@ -4132,11 +4095,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:
@@ -4162,4 +4125,4 @@ TEST_F(BluetoothChromeOSTest, Shutdown_OnStopDiscoveryError) {
EXPECT_EQ(1 + kNumberOfDiscoverySessions, error_callback_count_);
}
-} // namespace chromeos
+} // namespace bluez

Powered by Google App Engine
This is Rietveld 408576698