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

Side by Side Diff: remoting/protocol/authenticator_test_base.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 "remoting/protocol/authenticator_test_base.h" 5 #include "remoting/protocol/authenticator_test_base.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 base::Unretained(receiver), base::Unretained(sender), 109 base::Unretained(receiver), base::Unretained(sender),
110 receiver->started(), sender->started())); 110 receiver->started(), sender->started()));
111 } 111 }
112 112
113 void AuthenticatorTestBase::RunChannelAuth(bool expected_fail) { 113 void AuthenticatorTestBase::RunChannelAuth(bool expected_fail) {
114 client_fake_socket_.reset(new FakeStreamSocket()); 114 client_fake_socket_.reset(new FakeStreamSocket());
115 host_fake_socket_.reset(new FakeStreamSocket()); 115 host_fake_socket_.reset(new FakeStreamSocket());
116 client_fake_socket_->PairWith(host_fake_socket_.get()); 116 client_fake_socket_->PairWith(host_fake_socket_.get());
117 117
118 client_auth_->SecureAndAuthenticate( 118 client_auth_->SecureAndAuthenticate(
119 client_fake_socket_.PassAs<net::StreamSocket>(), 119 client_fake_socket_.Pass(),
120 base::Bind(&AuthenticatorTestBase::OnClientConnected, 120 base::Bind(&AuthenticatorTestBase::OnClientConnected,
121 base::Unretained(this))); 121 base::Unretained(this)));
122 122
123 host_auth_->SecureAndAuthenticate( 123 host_auth_->SecureAndAuthenticate(
124 host_fake_socket_.PassAs<net::StreamSocket>(), 124 host_fake_socket_.Pass(),
125 base::Bind(&AuthenticatorTestBase::OnHostConnected, 125 base::Bind(&AuthenticatorTestBase::OnHostConnected,
126 base::Unretained(this))); 126 base::Unretained(this)));
127 127
128 // Expect two callbacks to be called - the client callback and the host 128 // Expect two callbacks to be called - the client callback and the host
129 // callback. 129 // callback.
130 int callback_counter = 2; 130 int callback_counter = 2;
131 131
132 EXPECT_CALL(client_callback_, OnDone(net::OK)) 132 EXPECT_CALL(client_callback_, OnDone(net::OK))
133 .WillOnce(QuitThreadOnCounter(&callback_counter)); 133 .WillOnce(QuitThreadOnCounter(&callback_counter));
134 if (expected_fail) { 134 if (expected_fail) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 void AuthenticatorTestBase::OnClientConnected( 167 void AuthenticatorTestBase::OnClientConnected(
168 int error, 168 int error,
169 scoped_ptr<net::StreamSocket> socket) { 169 scoped_ptr<net::StreamSocket> socket) {
170 client_callback_.OnDone(error); 170 client_callback_.OnDone(error);
171 client_socket_ = socket.Pass(); 171 client_socket_ = socket.Pass();
172 } 172 }
173 173
174 } // namespace protocol 174 } // namespace protocol
175 } // namespace remoting 175 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698