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

Unified Diff: components/proximity_auth/cryptauth/cryptauth_enrollment_manager_unittest.cc

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 5 years 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/cryptauth/cryptauth_enrollment_manager_unittest.cc
diff --git a/components/proximity_auth/cryptauth/cryptauth_enrollment_manager_unittest.cc b/components/proximity_auth/cryptauth/cryptauth_enrollment_manager_unittest.cc
index 9b29842a1615d70da7fb7892013c2cc36d2dd4b6..99756d04e163d8e80c5e38f457c8eddd161418f0 100644
--- a/components/proximity_auth/cryptauth/cryptauth_enrollment_manager_unittest.cc
+++ b/components/proximity_auth/cryptauth/cryptauth_enrollment_manager_unittest.cc
@@ -4,6 +4,8 @@
#include "components/proximity_auth/cryptauth/cryptauth_enrollment_manager.h"
+#include <utility>
+
#include "base/base64url.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
@@ -75,9 +77,9 @@ class MockCryptAuthEnrollerFactory : public CryptAuthEnrollerFactory {
// CryptAuthEnrollerFactory:
scoped_ptr<CryptAuthEnroller> CreateInstance() override {
- auto passed_cryptauth_enroller = next_cryptauth_enroller_.Pass();
+ auto passed_cryptauth_enroller = std::move(next_cryptauth_enroller_);
next_cryptauth_enroller_.reset(new NiceMock<MockCryptAuthEnroller>());
- return passed_cryptauth_enroller.Pass();
+ return std::move(passed_cryptauth_enroller);
}
MockCryptAuthEnroller* next_cryptauth_enroller() {
@@ -102,9 +104,9 @@ class TestCryptAuthEnrollmentManager : public CryptAuthEnrollmentManager {
const cryptauth::GcmDeviceInfo& device_info,
CryptAuthGCMManager* gcm_manager,
PrefService* pref_service)
- : CryptAuthEnrollmentManager(clock.Pass(),
- enroller_factory.Pass(),
- secure_message_delegate.Pass(),
+ : CryptAuthEnrollmentManager(std::move(clock),
+ std::move(enroller_factory),
+ std::move(secure_message_delegate),
device_info,
gcm_manager,
pref_service),
@@ -115,7 +117,7 @@ class TestCryptAuthEnrollmentManager : public CryptAuthEnrollmentManager {
scoped_ptr<SyncScheduler> CreateSyncScheduler() override {
EXPECT_TRUE(scoped_sync_scheduler_);
- return scoped_sync_scheduler_.Pass();
+ return std::move(scoped_sync_scheduler_);
}
base::WeakPtr<MockSyncScheduler> GetSyncScheduler() {
@@ -224,7 +226,7 @@ class ProximityAuthCryptAuthEnrollmentManagerTest
SyncScheduler::Delegate* delegate =
static_cast<SyncScheduler::Delegate*>(&enrollment_manager_);
- delegate->OnSyncRequested(sync_request.Pass());
+ delegate->OnSyncRequested(std::move(sync_request));
return completion_callback;
}
@@ -305,7 +307,7 @@ TEST_F(ProximityAuthCryptAuthEnrollmentManagerTest, InitWithDefaultPrefs) {
CryptAuthEnrollmentManager::RegisterPrefs(pref_service.registry());
TestCryptAuthEnrollmentManager enrollment_manager(
- clock.Pass(), make_scoped_ptr(new MockCryptAuthEnrollerFactory()),
+ std::move(clock), make_scoped_ptr(new MockCryptAuthEnrollerFactory()),
make_scoped_ptr(new FakeSecureMessageDelegate()), device_info_,
&gcm_manager_, &pref_service);
@@ -409,7 +411,7 @@ TEST_F(ProximityAuthCryptAuthEnrollmentManagerTest,
auto sync_request = make_scoped_ptr(
new SyncScheduler::SyncRequest(enrollment_manager_.GetSyncScheduler()));
static_cast<SyncScheduler::Delegate*>(&enrollment_manager_)
- ->OnSyncRequested(sync_request.Pass());
+ ->OnSyncRequested(std::move(sync_request));
// Complete GCM registration successfully, and expect an enrollment.
CryptAuthEnroller::EnrollmentFinishedCallback enrollment_callback;
@@ -445,7 +447,7 @@ TEST_F(ProximityAuthCryptAuthEnrollmentManagerTest, GCMRegistrationFails) {
auto sync_request = make_scoped_ptr(
new SyncScheduler::SyncRequest(enrollment_manager_.GetSyncScheduler()));
static_cast<SyncScheduler::Delegate*>(&enrollment_manager_)
- ->OnSyncRequested(sync_request.Pass());
+ ->OnSyncRequested(std::move(sync_request));
// Complete GCM registration with failure.
EXPECT_CALL(*this, OnEnrollmentFinishedProxy(false));

Powered by Google App Engine
This is Rietveld 408576698