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

Unified Diff: components/proximity_auth/bluetooth_connection_unittest.cc

Issue 652403002: [Clean up] Expose ConnectToServiceInsecurely as a BluetoothDevice API on all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase: Restore deps rather than public_deps Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/proximity_auth/bluetooth_connection.cc ('k') | components/proximity_auth/bluetooth_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/bluetooth_connection_unittest.cc
diff --git a/components/proximity_auth/bluetooth_connection_unittest.cc b/components/proximity_auth/bluetooth_connection_unittest.cc
index 80c04e977af4aaa42c00b0bca63a0ae62ede9c6e..14765335d5a933bcf207f5ff3258190728994e4d 100644
--- a/components/proximity_auth/bluetooth_connection_unittest.cc
+++ b/components/proximity_auth/bluetooth_connection_unittest.cc
@@ -57,17 +57,6 @@ class MockBluetoothConnection : public BluetoothConnection {
MockBluetoothConnection()
: BluetoothConnection(kRemoteDevice, device::BluetoothUUID(kUuid)) {}
- // Bluetooth dependencies.
- typedef device::BluetoothDevice::ConnectToServiceCallback
- ConnectToServiceCallback;
- typedef device::BluetoothDevice::ConnectToServiceErrorCallback
- ConnectToServiceErrorCallback;
- MOCK_METHOD4(ConnectToService,
- void(device::BluetoothDevice* device,
- const device::BluetoothUUID& uuid,
- const ConnectToServiceCallback& callback,
- const ConnectToServiceErrorCallback& error_callback));
-
// Calls back into the parent Connection class.
MOCK_METHOD1(SetStatusProxy, void(Status status));
MOCK_METHOD1(OnBytesReceived, void(const std::string& bytes));
@@ -121,7 +110,7 @@ class ProximityAuthBluetoothConnectionTest : public testing::Test {
ON_CALL(*adapter_, GetDevice(_)).WillByDefault(Return(&device_));
EXPECT_CALL(*connection, SetStatusProxy(Connection::IN_PROGRESS));
EXPECT_CALL(*adapter_, AddObserver(connection));
- EXPECT_CALL(*connection, ConnectToService(&device_, uuid_, _, _));
+ EXPECT_CALL(device_, ConnectToServiceInsecurely(uuid_, _, _));
connection->Connect();
EXPECT_EQ(Connection::IN_PROGRESS, connection->status());
@@ -137,8 +126,8 @@ class ProximityAuthBluetoothConnectionTest : public testing::Test {
ON_CALL(*adapter_, GetDevice(_)).WillByDefault(Return(&device_));
EXPECT_CALL(*connection, SetStatusProxy(Connection::IN_PROGRESS));
EXPECT_CALL(*adapter_, AddObserver(connection));
- EXPECT_CALL(*connection, ConnectToService(_, _, _, _))
- .WillOnce(SaveArg<2>(&callback));
+ EXPECT_CALL(device_, ConnectToServiceInsecurely(_, _, _))
+ .WillOnce(SaveArg<1>(&callback));
connection->Connect();
ASSERT_FALSE(callback.is_null());
@@ -261,8 +250,8 @@ TEST_F(ProximityAuthBluetoothConnectionTest, Connect_ConnectionFails) {
ON_CALL(*adapter_, GetDevice(_)).WillByDefault(Return(&device_));
EXPECT_CALL(connection, SetStatusProxy(Connection::IN_PROGRESS));
EXPECT_CALL(*adapter_, AddObserver(&connection));
- EXPECT_CALL(connection, ConnectToService(&device_, uuid_, _, _))
- .WillOnce(SaveArg<3>(&error_callback));
+ EXPECT_CALL(device_, ConnectToServiceInsecurely(uuid_, _, _))
+ .WillOnce(SaveArg<2>(&error_callback));
connection.Connect();
ASSERT_FALSE(error_callback.is_null());
@@ -382,8 +371,8 @@ TEST_F(ProximityAuthBluetoothConnectionTest,
ON_CALL(*adapter_, GetDevice(_)).WillByDefault(Return(&device_));
EXPECT_CALL(connection, SetStatusProxy(Connection::IN_PROGRESS));
EXPECT_CALL(*adapter_, AddObserver(&connection));
- EXPECT_CALL(connection, ConnectToService(&device_, uuid_, _, _))
- .WillOnce(SaveArg<2>(&callback));
+ EXPECT_CALL(device_, ConnectToServiceInsecurely(uuid_, _, _))
+ .WillOnce(SaveArg<1>(&callback));
connection.Connect();
ASSERT_FALSE(callback.is_null());
« no previous file with comments | « components/proximity_auth/bluetooth_connection.cc ('k') | components/proximity_auth/bluetooth_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698