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

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

Issue 2438963002: bluetooth: Add tests for when frame reconnects during readValue (Closed)
Patch Set: Clean up Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/test/mock_bluetooth_device.cc
diff --git a/device/bluetooth/test/mock_bluetooth_device.cc b/device/bluetooth/test/mock_bluetooth_device.cc
index 9315ff545117ca28eed98621618057aa87d7a008..6528a0407dfcd417b858e811ed2570eda2d6f171 100644
--- a/device/bluetooth/test/mock_bluetooth_device.cc
+++ b/device/bluetooth/test/mock_bluetooth_device.cc
@@ -88,4 +88,18 @@ BluetoothRemoteGattService* MockBluetoothDevice::GetMockService(
return nullptr;
}
+void MockBluetoothDevice::PushPendingCallback(const base::Closure& callback) {
+ pending_callbacks_.push(callback);
+}
+
+base::Closure MockBluetoothDevice::PopPendingCallback() {
+ base::Closure callback = pending_callbacks_.front();
+ pending_callbacks_.pop();
+ return callback;
+}
+
+bool MockBluetoothDevice::HasPendingCallback() {
+ return !pending_callbacks_.empty();
+}
+
} // namespace device

Powered by Google App Engine
This is Rietveld 408576698