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

Side by Side Diff: remoting/protocol/negotiating_authenticator_unittest.cc

Issue 2253233004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "remoting/base/rsa_key_pair.h" 10 #include "remoting/base/rsa_key_pair.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 void DisableMethodOnHost(NegotiatingAuthenticatorBase::Method method) { 91 void DisableMethodOnHost(NegotiatingAuthenticatorBase::Method method) {
92 auto* methods = &(host_as_negotiating_authenticator_->methods_); 92 auto* methods = &(host_as_negotiating_authenticator_->methods_);
93 auto iter = std::find(methods->begin(), methods->end(), method); 93 auto iter = std::find(methods->begin(), methods->end(), method);
94 ASSERT_TRUE(iter != methods->end()); 94 ASSERT_TRUE(iter != methods->end());
95 methods->erase(iter); 95 methods->erase(iter);
96 } 96 }
97 97
98 void CreatePairingRegistry(bool with_paired_client) { 98 void CreatePairingRegistry(bool with_paired_client) {
99 pairing_registry_ = new SynchronousPairingRegistry( 99 pairing_registry_ = new SynchronousPairingRegistry(
100 base::WrapUnique(new MockPairingRegistryDelegate())); 100 base::MakeUnique<MockPairingRegistryDelegate>());
101 if (with_paired_client) { 101 if (with_paired_client) {
102 PairingRegistry::Pairing pairing( 102 PairingRegistry::Pairing pairing(
103 base::Time(), kTestClientName, kTestClientId, kTestPairedSecret); 103 base::Time(), kTestClientName, kTestClientId, kTestPairedSecret);
104 pairing_registry_->AddPairing(pairing); 104 pairing_registry_->AddPairing(pairing);
105 } 105 }
106 } 106 }
107 107
108 static void FetchSecret( 108 static void FetchSecret(
109 const std::string& client_secret, 109 const std::string& client_secret,
110 bool pairing_supported, 110 bool pairing_supported,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 TEST_P(NegotiatingPairingAuthenticatorTest, PairingFailedInvalidSecretAndPin) { 310 TEST_P(NegotiatingPairingAuthenticatorTest, PairingFailedInvalidSecretAndPin) {
311 CreatePairingRegistry(true); 311 CreatePairingRegistry(true);
312 ASSERT_NO_FATAL_FAILURE(InitAuthenticators( 312 ASSERT_NO_FATAL_FAILURE(InitAuthenticators(
313 kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin)); 313 kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin));
314 ASSERT_NO_FATAL_FAILURE(RunAuthExchange()); 314 ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
315 VerifyRejected(Authenticator::INVALID_CREDENTIALS); 315 VerifyRejected(Authenticator::INVALID_CREDENTIALS);
316 } 316 }
317 317
318 } // namespace protocol 318 } // namespace protocol
319 } // namespace remoting 319 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/ice_transport_unittest.cc ('k') | remoting/protocol/pairing_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698