| Index: device/bluetooth/bluetooth_local_gatt_characteristic_unittest.cc
|
| diff --git a/device/bluetooth/bluetooth_local_gatt_characteristic_unittest.cc b/device/bluetooth/bluetooth_local_gatt_characteristic_unittest.cc
|
| index e7f4fcc8f29de3d5a50cdb6f69c1ff13ef07c321..3523cd1cfebdf54a4dcf28481049cbc658a53201 100644
|
| --- a/device/bluetooth/bluetooth_local_gatt_characteristic_unittest.cc
|
| +++ b/device/bluetooth/bluetooth_local_gatt_characteristic_unittest.cc
|
| @@ -54,8 +54,8 @@ class BluetoothLocalGattCharacteristicTest : public BluetoothGattServerTest {
|
| TEST_F(BluetoothLocalGattCharacteristicTest, ReadLocalCharacteristicValue) {
|
| delegate_->value_to_write_ = 0x1337;
|
| SimulateLocalGattCharacteristicValueReadRequest(
|
| - service_.get(), read_characteristic_.get(),
|
| - GetReadValueCallback(Call::EXPECTED), GetCallback(Call::NOT_EXPECTED));
|
| + read_characteristic_.get(), GetReadValueCallback(Call::EXPECTED),
|
| + GetCallback(Call::NOT_EXPECTED));
|
|
|
| EXPECT_EQ(delegate_->value_to_write_, GetInteger(last_read_value_));
|
| }
|
| @@ -65,7 +65,7 @@ TEST_F(BluetoothLocalGattCharacteristicTest, ReadLocalCharacteristicValue) {
|
| TEST_F(BluetoothLocalGattCharacteristicTest, WriteLocalCharacteristicValue) {
|
| const uint64_t kValueToWrite = 0x7331ul;
|
| SimulateLocalGattCharacteristicValueWriteRequest(
|
| - service_.get(), write_characteristic_.get(), GetValue(kValueToWrite),
|
| + write_characteristic_.get(), GetValue(kValueToWrite),
|
| GetCallback(Call::EXPECTED), GetCallback(Call::NOT_EXPECTED));
|
|
|
| EXPECT_EQ(kValueToWrite, delegate_->last_written_value_);
|
| @@ -77,8 +77,8 @@ TEST_F(BluetoothLocalGattCharacteristicTest, ReadLocalCharacteristicValueFail) {
|
| delegate_->value_to_write_ = 0x1337;
|
| delegate_->should_fail_ = true;
|
| SimulateLocalGattCharacteristicValueReadRequest(
|
| - service_.get(), read_characteristic_.get(),
|
| - GetReadValueCallback(Call::NOT_EXPECTED), GetCallback(Call::EXPECTED));
|
| + read_characteristic_.get(), GetReadValueCallback(Call::NOT_EXPECTED),
|
| + GetCallback(Call::EXPECTED));
|
|
|
| EXPECT_NE(delegate_->value_to_write_, GetInteger(last_read_value_));
|
| }
|
| @@ -89,8 +89,8 @@ TEST_F(BluetoothLocalGattCharacteristicTest,
|
| ReadLocalCharacteristicValueWrongPermission) {
|
| delegate_->value_to_write_ = 0x1337;
|
| SimulateLocalGattCharacteristicValueReadRequest(
|
| - service_.get(), write_characteristic_.get(),
|
| - GetReadValueCallback(Call::NOT_EXPECTED), GetCallback(Call::EXPECTED));
|
| + write_characteristic_.get(), GetReadValueCallback(Call::NOT_EXPECTED),
|
| + GetCallback(Call::EXPECTED));
|
|
|
| EXPECT_NE(delegate_->value_to_write_, GetInteger(last_read_value_));
|
| }
|
| @@ -102,7 +102,7 @@ TEST_F(BluetoothLocalGattCharacteristicTest,
|
| const uint64_t kValueToWrite = 0x7331ul;
|
| delegate_->should_fail_ = true;
|
| SimulateLocalGattCharacteristicValueWriteRequest(
|
| - service_.get(), write_characteristic_.get(), GetValue(kValueToWrite),
|
| + write_characteristic_.get(), GetValue(kValueToWrite),
|
| GetCallback(Call::NOT_EXPECTED), GetCallback(Call::EXPECTED));
|
|
|
| EXPECT_NE(kValueToWrite, delegate_->last_written_value_);
|
| @@ -114,7 +114,7 @@ TEST_F(BluetoothLocalGattCharacteristicTest,
|
| WriteLocalCharacteristicValueWrongPermission) {
|
| const uint64_t kValueToWrite = 0x7331ul;
|
| SimulateLocalGattCharacteristicValueWriteRequest(
|
| - service_.get(), read_characteristic_.get(), GetValue(kValueToWrite),
|
| + read_characteristic_.get(), GetValue(kValueToWrite),
|
| GetCallback(Call::NOT_EXPECTED), GetCallback(Call::EXPECTED));
|
|
|
| EXPECT_NE(kValueToWrite, delegate_->last_written_value_);
|
| @@ -124,22 +124,22 @@ TEST_F(BluetoothLocalGattCharacteristicTest,
|
| #if defined(OS_CHROMEOS) || defined(OS_LINUX)
|
| TEST_F(BluetoothLocalGattCharacteristicTest, StartAndStopNotifications) {
|
| EXPECT_FALSE(SimulateLocalGattCharacteristicNotificationsRequest(
|
| - service_.get(), read_characteristic_.get(), true));
|
| + read_characteristic_.get(), true));
|
| EXPECT_FALSE(delegate_->NotificationStatusForCharacteristic(
|
| read_characteristic_.get()));
|
|
|
| EXPECT_FALSE(SimulateLocalGattCharacteristicNotificationsRequest(
|
| - service_.get(), write_characteristic_.get(), true));
|
| + write_characteristic_.get(), true));
|
| EXPECT_FALSE(delegate_->NotificationStatusForCharacteristic(
|
| write_characteristic_.get()));
|
|
|
| EXPECT_TRUE(SimulateLocalGattCharacteristicNotificationsRequest(
|
| - service_.get(), notify_characteristic_.get(), true));
|
| + notify_characteristic_.get(), true));
|
| EXPECT_TRUE(delegate_->NotificationStatusForCharacteristic(
|
| notify_characteristic_.get()));
|
|
|
| EXPECT_TRUE(SimulateLocalGattCharacteristicNotificationsRequest(
|
| - service_.get(), notify_characteristic_.get(), false));
|
| + notify_characteristic_.get(), false));
|
| EXPECT_FALSE(delegate_->NotificationStatusForCharacteristic(
|
| notify_characteristic_.get()));
|
| }
|
| @@ -149,15 +149,15 @@ TEST_F(BluetoothLocalGattCharacteristicTest, StartAndStopNotifications) {
|
| TEST_F(BluetoothLocalGattCharacteristicTest, SendNotifications) {
|
| const uint64_t kNotifyValue = 0x7331ul;
|
| EXPECT_EQ(BluetoothLocalGattCharacteristic::NOTIFICATION_SUCCESS,
|
| - notify_characteristic_->NotifyValueChanged(GetValue(kNotifyValue),
|
| - false));
|
| + notify_characteristic_->NotifyValueChanged(
|
| + nullptr, GetValue(kNotifyValue), false));
|
| EXPECT_EQ(kNotifyValue, GetInteger(LastNotifactionValueForCharacteristic(
|
| notify_characteristic_.get())));
|
|
|
| const uint64_t kIndicateValue = 0x1337ul;
|
| EXPECT_EQ(BluetoothLocalGattCharacteristic::NOTIFICATION_SUCCESS,
|
| indicate_characteristic_->NotifyValueChanged(
|
| - GetValue(kIndicateValue), true));
|
| + nullptr, GetValue(kIndicateValue), true));
|
| EXPECT_EQ(kIndicateValue, GetInteger(LastNotifactionValueForCharacteristic(
|
| indicate_characteristic_.get())));
|
| }
|
| @@ -166,29 +166,29 @@ TEST_F(BluetoothLocalGattCharacteristicTest, SendNotifications) {
|
| #if defined(OS_CHROMEOS) || defined(OS_LINUX)
|
| TEST_F(BluetoothLocalGattCharacteristicTest, SendNotificationsWrongProperties) {
|
| const uint64_t kNewValue = 0x3334ul;
|
| - EXPECT_EQ(
|
| - BluetoothLocalGattCharacteristic::NOTIFY_PROPERTY_NOT_SET,
|
| - read_characteristic_->NotifyValueChanged(GetValue(kNewValue), false));
|
| + EXPECT_EQ(BluetoothLocalGattCharacteristic::NOTIFY_PROPERTY_NOT_SET,
|
| + read_characteristic_->NotifyValueChanged(
|
| + nullptr, GetValue(kNewValue), false));
|
| EXPECT_NE(kNewValue, GetInteger(LastNotifactionValueForCharacteristic(
|
| read_characteristic_.get())));
|
|
|
| - EXPECT_EQ(
|
| - BluetoothLocalGattCharacteristic::NOTIFY_PROPERTY_NOT_SET,
|
| - write_characteristic_->NotifyValueChanged(GetValue(kNewValue), false));
|
| + EXPECT_EQ(BluetoothLocalGattCharacteristic::NOTIFY_PROPERTY_NOT_SET,
|
| + write_characteristic_->NotifyValueChanged(
|
| + nullptr, GetValue(kNewValue), false));
|
| EXPECT_NE(kNewValue, GetInteger(LastNotifactionValueForCharacteristic(
|
| write_characteristic_.get())));
|
|
|
| const uint64_t kNotifyValue = 0x7331ul;
|
| - EXPECT_EQ(
|
| - BluetoothLocalGattCharacteristic::INDICATE_PROPERTY_NOT_SET,
|
| - notify_characteristic_->NotifyValueChanged(GetValue(kNotifyValue), true));
|
| + EXPECT_EQ(BluetoothLocalGattCharacteristic::INDICATE_PROPERTY_NOT_SET,
|
| + notify_characteristic_->NotifyValueChanged(
|
| + nullptr, GetValue(kNotifyValue), true));
|
| EXPECT_NE(kNotifyValue, GetInteger(LastNotifactionValueForCharacteristic(
|
| notify_characteristic_.get())));
|
|
|
| const uint64_t kIndicateValue = 0x1337ul;
|
| EXPECT_EQ(BluetoothLocalGattCharacteristic::NOTIFY_PROPERTY_NOT_SET,
|
| indicate_characteristic_->NotifyValueChanged(
|
| - GetValue(kIndicateValue), false));
|
| + nullptr, GetValue(kIndicateValue), false));
|
| EXPECT_NE(kIndicateValue, GetInteger(LastNotifactionValueForCharacteristic(
|
| indicate_characteristic_.get())));
|
| }
|
| @@ -201,8 +201,8 @@ TEST_F(BluetoothLocalGattCharacteristicTest,
|
| GetGattErrorCallback(Call::NOT_EXPECTED));
|
| const uint64_t kNotifyValue = 0x7331ul;
|
| EXPECT_EQ(BluetoothLocalGattCharacteristic::SERVICE_NOT_REGISTERED,
|
| - notify_characteristic_->NotifyValueChanged(GetValue(kNotifyValue),
|
| - false));
|
| + notify_characteristic_->NotifyValueChanged(
|
| + nullptr, GetValue(kNotifyValue), false));
|
| EXPECT_NE(kNotifyValue, GetInteger(LastNotifactionValueForCharacteristic(
|
| notify_characteristic_.get())));
|
| }
|
|
|