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

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

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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
« no previous file with comments | « remoting/protocol/authenticator_test_base.h ('k') | remoting/protocol/capture_scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 7 #include <utility>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 // static 79 // static
80 // This function sends a message from the sender and receiver and recursively 80 // This function sends a message from the sender and receiver and recursively
81 // calls itself to the send the next message from the receiver to the sender 81 // calls itself to the send the next message from the receiver to the sender
82 // untils the authentication completes. 82 // untils the authentication completes.
83 void AuthenticatorTestBase::ContinueAuthExchangeWith(Authenticator* sender, 83 void AuthenticatorTestBase::ContinueAuthExchangeWith(Authenticator* sender,
84 Authenticator* receiver, 84 Authenticator* receiver,
85 bool sender_started, 85 bool sender_started,
86 bool receiver_started) { 86 bool receiver_started) {
87 scoped_ptr<buzz::XmlElement> message; 87 std::unique_ptr<buzz::XmlElement> message;
88 ASSERT_NE(Authenticator::WAITING_MESSAGE, sender->state()); 88 ASSERT_NE(Authenticator::WAITING_MESSAGE, sender->state());
89 if (sender->state() == Authenticator::ACCEPTED || 89 if (sender->state() == Authenticator::ACCEPTED ||
90 sender->state() == Authenticator::REJECTED) { 90 sender->state() == Authenticator::REJECTED) {
91 return; 91 return;
92 } 92 }
93 93
94 // Verify that once the started flag for either party is set to true, 94 // Verify that once the started flag for either party is set to true,
95 // it should always stay true. 95 // it should always stay true.
96 if (receiver_started) { 96 if (receiver_started) {
97 ASSERT_TRUE(receiver->started()); 97 ASSERT_TRUE(receiver->started());
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 testing::Mock::VerifyAndClearExpectations(&host_callback_); 154 testing::Mock::VerifyAndClearExpectations(&host_callback_);
155 155
156 if (!expected_fail) { 156 if (!expected_fail) {
157 ASSERT_TRUE(client_socket_.get() != nullptr); 157 ASSERT_TRUE(client_socket_.get() != nullptr);
158 ASSERT_TRUE(host_socket_.get() != nullptr); 158 ASSERT_TRUE(host_socket_.get() != nullptr);
159 } 159 }
160 } 160 }
161 161
162 void AuthenticatorTestBase::OnHostConnected( 162 void AuthenticatorTestBase::OnHostConnected(
163 int error, 163 int error,
164 scoped_ptr<P2PStreamSocket> socket) { 164 std::unique_ptr<P2PStreamSocket> socket) {
165 host_callback_.OnDone(error); 165 host_callback_.OnDone(error);
166 host_socket_ = std::move(socket); 166 host_socket_ = std::move(socket);
167 } 167 }
168 168
169 void AuthenticatorTestBase::OnClientConnected( 169 void AuthenticatorTestBase::OnClientConnected(
170 int error, 170 int error,
171 scoped_ptr<P2PStreamSocket> socket) { 171 std::unique_ptr<P2PStreamSocket> socket) {
172 client_callback_.OnDone(error); 172 client_callback_.OnDone(error);
173 client_socket_ = std::move(socket); 173 client_socket_ = std::move(socket);
174 } 174 }
175 175
176 } // namespace protocol 176 } // namespace protocol
177 } // namespace remoting 177 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/authenticator_test_base.h ('k') | remoting/protocol/capture_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698