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

Unified Diff: components/proximity_auth/device_to_device_authenticator_unittest.cc

Issue 1912433002: Convert //components/proximity_auth from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 8 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/device_to_device_authenticator_unittest.cc
diff --git a/components/proximity_auth/device_to_device_authenticator_unittest.cc b/components/proximity_auth/device_to_device_authenticator_unittest.cc
index 0a1b085cde5993b24d929906e00dc9bf51b35026..ef8d8125a316454242ed3bb9e562e9c61a50aa2c 100644
--- a/components/proximity_auth/device_to_device_authenticator_unittest.cc
+++ b/components/proximity_auth/device_to_device_authenticator_unittest.cc
@@ -9,6 +9,7 @@
#include "base/base64url.h"
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/scoped_vector.h"
#include "base/rand_util.h"
#include "base/timer/mock_timer.h"
@@ -84,7 +85,7 @@ class FakeConnection : public Connection {
protected:
// Connection:
- void SendMessageImpl(scoped_ptr<WireMessage> message) override {
+ void SendMessageImpl(std::unique_ptr<WireMessage> message) override {
const WireMessage& message_alias = *message;
message_buffer_.push_back(std::move(message));
OnDidSendMessage(message_alias, !connection_blocked_);
@@ -103,7 +104,7 @@ class DeviceToDeviceAuthenticatorForTest : public DeviceToDeviceAuthenticator {
public:
DeviceToDeviceAuthenticatorForTest(
Connection* connection,
- scoped_ptr<SecureMessageDelegate> secure_message_delegate)
+ std::unique_ptr<SecureMessageDelegate> secure_message_delegate)
: DeviceToDeviceAuthenticator(connection,
kAccountId,
std::move(secure_message_delegate)),
@@ -114,11 +115,11 @@ class DeviceToDeviceAuthenticatorForTest : public DeviceToDeviceAuthenticator {
private:
// DeviceToDeviceAuthenticator:
- scoped_ptr<base::Timer> CreateTimer() override {
+ std::unique_ptr<base::Timer> CreateTimer() override {
bool retain_user_task = false;
bool is_repeating = false;
- scoped_ptr<base::MockTimer> timer(
+ std::unique_ptr<base::MockTimer> timer(
new base::MockTimer(retain_user_task, is_repeating));
timer_ = timer.get();
@@ -140,7 +141,7 @@ class ProximityAuthDeviceToDeviceAuthenticatorTest : public testing::Test {
connection_(remote_device_),
secure_message_delegate_(new FakeSecureMessageDelegate),
authenticator_(&connection_,
- make_scoped_ptr(secure_message_delegate_)) {}
+ base::WrapUnique(secure_message_delegate_)) {}
~ProximityAuthDeviceToDeviceAuthenticatorTest() override {}
void SetUp() override {
@@ -213,7 +214,7 @@ class ProximityAuthDeviceToDeviceAuthenticatorTest : public testing::Test {
}
void OnAuthenticationResult(Authenticator::Result result,
- scoped_ptr<SecureContext> secure_context) {
+ std::unique_ptr<SecureContext> secure_context) {
secure_context_ = std::move(secure_context);
OnAuthenticationResultProxy(result);
}
@@ -240,7 +241,7 @@ class ProximityAuthDeviceToDeviceAuthenticatorTest : public testing::Test {
std::string session_symmetric_key_;
// Stores the SecureContext returned after authentication succeeds.
- scoped_ptr<SecureContext> secure_context_;
+ std::unique_ptr<SecureContext> secure_context_;
DISALLOW_COPY_AND_ASSIGN(ProximityAuthDeviceToDeviceAuthenticatorTest);
};
@@ -340,10 +341,10 @@ TEST_F(ProximityAuthDeviceToDeviceAuthenticatorTest,
// completes.
WireMessage wire_message(base::RandBytesAsString(300u));
connection_.SendMessage(
- make_scoped_ptr(new WireMessage(base::RandBytesAsString(300u))));
+ base::WrapUnique(new WireMessage(base::RandBytesAsString(300u))));
connection_.OnBytesReceived(wire_message.Serialize());
connection_.SendMessage(
- make_scoped_ptr(new WireMessage(base::RandBytesAsString(300u))));
+ base::WrapUnique(new WireMessage(base::RandBytesAsString(300u))));
connection_.OnBytesReceived(wire_message.Serialize());
}

Powered by Google App Engine
This is Rietveld 408576698