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

Unified Diff: device/bluetooth/test/bluetooth_test.cc

Issue 1256313002: bluetooth: android: Implement & test CreateGattConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated patchset dependency Created 5 years, 4 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/test/bluetooth_test.cc
diff --git a/device/bluetooth/test/bluetooth_test.cc b/device/bluetooth/test/bluetooth_test.cc
index 45425fa2ccb41e711329589a2545dd288f2c7a89..a487d413bca5254e17532a9e3d6b8fe5464dff88 100644
--- a/device/bluetooth/test/bluetooth_test.cc
+++ b/device/bluetooth/test/bluetooth_test.cc
@@ -41,10 +41,22 @@ void BluetoothTestBase::DiscoverySessionCallback(
discovery_sessions_.push_back(discovery_session.release());
}
+void BluetoothTestBase::GattConnectionCallback(
+ scoped_ptr<BluetoothGattConnection> connection) {
+ ++callback_count_;
+ gatt_connections_.push_back(connection.release());
+}
+
void BluetoothTestBase::ErrorCallback() {
++error_callback_count_;
}
+void BluetoothTestBase::ConnectErrorCallback(
+ enum BluetoothDevice::ConnectErrorCode error_code) {
+ ++error_callback_count_;
+ last_connect_error_code_ = error_code;
+}
+
base::Closure BluetoothTestBase::GetCallback() {
return base::Bind(&BluetoothTestBase::Callback, base::Unretained(this));
}
@@ -55,8 +67,20 @@ BluetoothTestBase::GetDiscoverySessionCallback() {
base::Unretained(this));
}
+BluetoothDevice::GattConnectionCallback
+BluetoothTestBase::GetGattConnectionCallback() {
+ return base::Bind(&BluetoothTestBase::GattConnectionCallback,
+ base::Unretained(this));
Jeffrey Yasskin 2015/08/20 21:35:14 Generally comment why base::Unretained calls are c
scheib 2015/09/13 02:41:01 Done - moved to weak pointers.
+}
+
BluetoothAdapter::ErrorCallback BluetoothTestBase::GetErrorCallback() {
return base::Bind(&BluetoothTestBase::ErrorCallback, base::Unretained(this));
}
+BluetoothDevice::ConnectErrorCallback
+BluetoothTestBase::GetConnectErrorCallback() {
+ return base::Bind(&BluetoothTestBase::ConnectErrorCallback,
+ base::Unretained(this));
+}
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698