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

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

Issue 1534193004: Use std::move() instead of scoped_ptr<>::Pass(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/callback_helpers.h" 6 #include "base/callback_helpers.h"
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 #include "remoting/base/rsa_key_pair.h" 8 #include "remoting/base/rsa_key_pair.h"
9 #include "remoting/protocol/authenticator_test_base.h" 9 #include "remoting/protocol/authenticator_test_base.h"
10 #include "remoting/protocol/channel_authenticator.h" 10 #include "remoting/protocol/channel_authenticator.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 public: 94 public:
95 ThirdPartyAuthenticatorTest() {} 95 ThirdPartyAuthenticatorTest() {}
96 ~ThirdPartyAuthenticatorTest() override {} 96 ~ThirdPartyAuthenticatorTest() override {}
97 97
98 protected: 98 protected:
99 void InitAuthenticators() { 99 void InitAuthenticators() {
100 scoped_ptr<TokenValidator> token_validator(new FakeTokenValidator()); 100 scoped_ptr<TokenValidator> token_validator(new FakeTokenValidator());
101 token_validator_ = static_cast<FakeTokenValidator*>(token_validator.get()); 101 token_validator_ = static_cast<FakeTokenValidator*>(token_validator.get());
102 host_.reset(new ThirdPartyHostAuthenticator( 102 host_.reset(new ThirdPartyHostAuthenticator(
103 host_cert_, key_pair_, token_validator.Pass())); 103 host_cert_, key_pair_, std::move(token_validator)));
104 scoped_ptr<ThirdPartyClientAuthenticator::TokenFetcher> 104 scoped_ptr<ThirdPartyClientAuthenticator::TokenFetcher>
105 token_fetcher(new FakeTokenFetcher()); 105 token_fetcher(new FakeTokenFetcher());
106 token_fetcher_ = static_cast<FakeTokenFetcher*>(token_fetcher.get()); 106 token_fetcher_ = static_cast<FakeTokenFetcher*>(token_fetcher.get());
107 client_.reset(new ThirdPartyClientAuthenticator(token_fetcher.Pass())); 107 client_.reset(new ThirdPartyClientAuthenticator(std::move(token_fetcher)));
108 } 108 }
109 109
110 FakeTokenFetcher* token_fetcher_; 110 FakeTokenFetcher* token_fetcher_;
111 FakeTokenValidator* token_validator_; 111 FakeTokenValidator* token_validator_;
112 112
113 private: 113 private:
114 DISALLOW_COPY_AND_ASSIGN(ThirdPartyAuthenticatorTest); 114 DISALLOW_COPY_AND_ASSIGN(ThirdPartyAuthenticatorTest);
115 }; 115 };
116 116
117 TEST_F(ThirdPartyAuthenticatorTest, SuccessfulAuth) { 117 TEST_F(ThirdPartyAuthenticatorTest, SuccessfulAuth) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 ASSERT_EQ(Authenticator::PROCESSING_MESSAGE, host_->state()); 202 ASSERT_EQ(Authenticator::PROCESSING_MESSAGE, host_->state());
203 ASSERT_NO_FATAL_FAILURE( 203 ASSERT_NO_FATAL_FAILURE(
204 token_validator_->OnTokenValidated(kSharedSecret)); 204 token_validator_->OnTokenValidated(kSharedSecret));
205 205
206 // The end result is that the host rejected the fake authentication. 206 // The end result is that the host rejected the fake authentication.
207 ASSERT_EQ(Authenticator::REJECTED, client_->state()); 207 ASSERT_EQ(Authenticator::REJECTED, client_->state());
208 } 208 }
209 209
210 } // namespace protocol 210 } // namespace protocol
211 } // namespace remoting 211 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698