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

Unified Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc

Issue 2089313006: bluetooth: Avoid use of lambda to work around clang bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove cast Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc b/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
index 37f205f6c8c8095b011244ae1b6863ad2bf7898d..14f082db6dd5ccf8c677a382421a258d1dc8eb8e 100644
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
@@ -398,6 +398,16 @@ TEST_F(BluetoothRemoteGattCharacteristicTest, ReadRemoteCharacteristic) {
#endif // defined(OS_ANDROID) || defined(OS_WIN)
#if defined(OS_ANDROID) || defined(OS_WIN)
+// Callback that make sure GattCharacteristicValueChanged has been called
+// before the callback runs.
+static void test_callback(
+ BluetoothRemoteGattCharacteristic::ValueCallback callback,
+ const TestBluetoothAdapterObserver& callback_observer,
+ const std::vector<uint8_t>& value) {
+ EXPECT_EQ(1, callback_observer.gatt_characteristic_value_changed_count());
+ callback.Run(value);
+}
+
// Tests that ReadRemoteCharacteristic results in a
// GattCharacteristicValueChanged call.
TEST_F(BluetoothRemoteGattCharacteristicTest,
@@ -407,21 +417,8 @@ TEST_F(BluetoothRemoteGattCharacteristicTest,
TestBluetoothAdapterObserver observer(adapter_);
- // Callback that make sure GattCharacteristicValueChanged has been called
- // before the callback runs.
- auto test_callback = [](
- BluetoothRemoteGattCharacteristic::ValueCallback callback,
- const TestBluetoothAdapterObserver& callback_observer,
- const std::vector<uint8_t>& value) {
- EXPECT_EQ(1, callback_observer.gatt_characteristic_value_changed_count());
- callback.Run(value);
- };
-
characteristic1_->ReadRemoteCharacteristic(
- base::Bind((void (*)(BluetoothRemoteGattCharacteristic::ValueCallback,
- const TestBluetoothAdapterObserver&,
- const std::vector<uint8_t>&))test_callback,
- GetReadValueCallback(Call::EXPECTED),
+ base::Bind(test_callback, GetReadValueCallback(Call::EXPECTED),
base::ConstRef(observer)),
GetGattErrorCallback(Call::NOT_EXPECTED));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698