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

Unified Diff: components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc

Issue 2250023005: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc
diff --git a/components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc b/components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc
index 476de39a8fd4e1ecb8752bebbe57b12f1bdc0a14..9555b205fbb9b7ceccf7a4399594beb12a1ec7bd 100644
--- a/components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc
+++ b/components/proximity_auth/ble/bluetooth_low_energy_weave_client_connection_unittest.cc
@@ -362,23 +362,23 @@ class ProximityAuthBluetoothLowEnergyWeaveClientConnectionTest
}
void SetUp() override {
- device_ = base::WrapUnique(new NiceMock<device::MockBluetoothDevice>(
+ device_ = base::MakeUnique<NiceMock<device::MockBluetoothDevice>>(
adapter_.get(), 0, kTestRemoteDeviceName,
- kTestRemoteDeviceBluetoothAddress, false, false));
+ kTestRemoteDeviceBluetoothAddress, false, false);
- service_ = base::WrapUnique(new NiceMock<device::MockBluetoothGattService>(
- device_.get(), kServiceID, service_uuid_, true, false));
+ service_ = base::MakeUnique<NiceMock<device::MockBluetoothGattService>>(
+ device_.get(), kServiceID, service_uuid_, true, false);
tx_characteristic_ =
- base::WrapUnique(new NiceMock<device::MockBluetoothGattCharacteristic>(
+ base::MakeUnique<NiceMock<device::MockBluetoothGattCharacteristic>>(
service_.get(), kTXCharacteristicID, tx_characteristic_uuid_, false,
kCharacteristicProperties,
- device::BluetoothRemoteGattCharacteristic::PERMISSION_NONE));
+ device::BluetoothRemoteGattCharacteristic::PERMISSION_NONE);
rx_characteristic_ =
- base::WrapUnique(new NiceMock<device::MockBluetoothGattCharacteristic>(
+ base::MakeUnique<NiceMock<device::MockBluetoothGattCharacteristic>>(
service_.get(), kRXCharacteristicID, rx_characteristic_uuid_, false,
kCharacteristicProperties,
- device::BluetoothRemoteGattCharacteristic::PERMISSION_NONE));
+ device::BluetoothRemoteGattCharacteristic::PERMISSION_NONE);
device::BluetoothAdapterFactory::SetAdapterForTesting(adapter_);
@@ -445,8 +445,8 @@ class ProximityAuthBluetoothLowEnergyWeaveClientConnectionTest
Return(new NiceMock<MockBluetoothLowEnergyCharacteristicsFinder>)));
create_gatt_connection_success_callback_.Run(
- base::WrapUnique(new NiceMock<device::MockBluetoothGattConnection>(
- adapter_, kTestRemoteDeviceBluetoothAddress)));
+ base::MakeUnique<NiceMock<device::MockBluetoothGattConnection>>(
+ adapter_, kTestRemoteDeviceBluetoothAddress));
EXPECT_EQ(connection->sub_status(), SubStatus::WAITING_CHARACTERISTICS);
EXPECT_EQ(connection->status(), Connection::IN_PROGRESS);
@@ -799,7 +799,7 @@ TEST_F(ProximityAuthBluetoothLowEnergyWeaveClientConnectionTest,
SaveArg<1>(&write_remote_characteristic_success_callback_),
SaveArg<2>(&write_remote_characteristic_error_callback_)));
- connection->SendMessage(base::WrapUnique(new FakeWireMessage(kSmallMessage)));
+ connection->SendMessage(base::MakeUnique<FakeWireMessage>(kSmallMessage));
EXPECT_EQ(last_value_written_on_tx_characteristic_, kSmallPackets0);
@@ -825,7 +825,7 @@ TEST_F(ProximityAuthBluetoothLowEnergyWeaveClientConnectionTest,
SaveArg<1>(&write_remote_characteristic_success_callback_),
SaveArg<2>(&write_remote_characteristic_error_callback_)));
- connection->SendMessage(base::WrapUnique(new FakeWireMessage(kLargeMessage)));
+ connection->SendMessage(base::MakeUnique<FakeWireMessage>(kLargeMessage));
EXPECT_EQ(last_value_written_on_tx_characteristic_, kLargePackets0);
std::vector<uint8_t> bytes_received(
@@ -866,7 +866,7 @@ TEST_F(ProximityAuthBluetoothLowEnergyWeaveClientConnectionTest,
SaveArg<1>(&write_remote_characteristic_success_callback_),
SaveArg<2>(&write_remote_characteristic_error_callback_)));
- connection->SendMessage(base::WrapUnique(new FakeWireMessage(kSmallMessage)));
+ connection->SendMessage(base::MakeUnique<FakeWireMessage>(kSmallMessage));
for (int i = 0; i < kMaxNumberOfTries; i++) {
EXPECT_EQ(last_value_written_on_tx_characteristic_, kSmallPackets0);
@@ -942,7 +942,7 @@ TEST_F(ProximityAuthBluetoothLowEnergyWeaveClientConnectionTest,
SaveArg<1>(&write_remote_characteristic_success_callback_),
SaveArg<2>(&write_remote_characteristic_error_callback_)));
- connection->SendMessage(base::WrapUnique(new FakeWireMessage(kLargeMessage)));
+ connection->SendMessage(base::MakeUnique<FakeWireMessage>(kLargeMessage));
connection->GattCharacteristicValueChanged(
adapter_.get(), rx_characteristic_.get(), kErroneousPacket);
@@ -1036,8 +1036,8 @@ TEST_F(ProximityAuthBluetoothLowEnergyWeaveClientConnectionTest,
Return(new NiceMock<MockBluetoothLowEnergyCharacteristicsFinder>)));
create_gatt_connection_success_callback_.Run(
- base::WrapUnique(new NiceMock<device::MockBluetoothGattConnection>(
- adapter_, kTestRemoteDeviceBluetoothAddress)));
+ base::MakeUnique<NiceMock<device::MockBluetoothGattConnection>>(
+ adapter_, kTestRemoteDeviceBluetoothAddress));
CharacteristicsFound(connection.get());
NotifySessionStarted(connection.get());

Powered by Google App Engine
This is Rietveld 408576698