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

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

Issue 609923004: Cleanup usage of scoped_ptr<> in remoting for C++11 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 "net/base/net_errors.h" 6 #include "net/base/net_errors.h"
7 #include "remoting/base/rsa_key_pair.h" 7 #include "remoting/base/rsa_key_pair.h"
8 #include "remoting/protocol/authenticator_test_base.h" 8 #include "remoting/protocol/authenticator_test_base.h"
9 #include "remoting/protocol/channel_authenticator.h" 9 #include "remoting/protocol/channel_authenticator.h"
10 #include "remoting/protocol/connection_tester.h" 10 #include "remoting/protocol/connection_tester.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 AuthenticationMethod::NONE)); 72 AuthenticationMethod::NONE));
73 } 73 }
74 bool pairing_expected = pairing_registry_.get() != NULL; 74 bool pairing_expected = pairing_registry_.get() != NULL;
75 FetchSecretCallback fetch_secret_callback = 75 FetchSecretCallback fetch_secret_callback =
76 base::Bind(&NegotiatingAuthenticatorTest::FetchSecret, 76 base::Bind(&NegotiatingAuthenticatorTest::FetchSecret,
77 client_interactive_pin, 77 client_interactive_pin,
78 pairing_expected); 78 pairing_expected);
79 client_as_negotiating_authenticator_ = new NegotiatingClientAuthenticator( 79 client_as_negotiating_authenticator_ = new NegotiatingClientAuthenticator(
80 client_id, client_paired_secret, 80 client_id, client_paired_secret,
81 kTestHostId, fetch_secret_callback, 81 kTestHostId, fetch_secret_callback,
82 scoped_ptr<ThirdPartyClientAuthenticator::TokenFetcher>(), methods); 82 nullptr, methods);
83 client_.reset(client_as_negotiating_authenticator_); 83 client_.reset(client_as_negotiating_authenticator_);
84 } 84 }
85 85
86 void CreatePairingRegistry(bool with_paired_client) { 86 void CreatePairingRegistry(bool with_paired_client) {
87 pairing_registry_ = new SynchronousPairingRegistry( 87 pairing_registry_ = new SynchronousPairingRegistry(
88 scoped_ptr<PairingRegistry::Delegate>( 88 scoped_ptr<PairingRegistry::Delegate>(
89 new MockPairingRegistryDelegate())); 89 new MockPairingRegistryDelegate()));
90 if (with_paired_client) { 90 if (with_paired_client) {
91 PairingRegistry::Pairing pairing( 91 PairingRegistry::Pairing pairing(
92 base::Time(), kTestClientName, kTestClientId, kTestPairedSecret); 92 base::Time(), kTestClientName, kTestClientId, kTestPairedSecret);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 CreatePairingRegistry(true); 248 CreatePairingRegistry(true);
249 ASSERT_NO_FATAL_FAILURE(InitAuthenticators( 249 ASSERT_NO_FATAL_FAILURE(InitAuthenticators(
250 kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin, 250 kTestClientId, kTestPairedSecretBad, kTestPinBad, kTestPin,
251 AuthenticationMethod::HMAC_SHA256, false)); 251 AuthenticationMethod::HMAC_SHA256, false));
252 ASSERT_NO_FATAL_FAILURE(RunAuthExchange()); 252 ASSERT_NO_FATAL_FAILURE(RunAuthExchange());
253 VerifyRejected(Authenticator::INVALID_CREDENTIALS); 253 VerifyRejected(Authenticator::INVALID_CREDENTIALS);
254 } 254 }
255 255
256 } // namespace protocol 256 } // namespace protocol
257 } // namespace remoting 257 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698