OLD | NEW |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 scoped_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 // 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, |
94 // it should always stay true. | 95 // it should always stay true. |
95 if (receiver_started) { | 96 if (receiver_started) { |
96 ASSERT_TRUE(receiver->started()); | 97 ASSERT_TRUE(receiver->started()); |
97 } | 98 } |
98 | 99 |
99 if (sender_started) { | 100 if (sender_started) { |
100 ASSERT_TRUE(sender->started()); | 101 ASSERT_TRUE(sender->started()); |
101 } | 102 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 168 |
168 void AuthenticatorTestBase::OnClientConnected( | 169 void AuthenticatorTestBase::OnClientConnected( |
169 int error, | 170 int error, |
170 scoped_ptr<P2PStreamSocket> socket) { | 171 scoped_ptr<P2PStreamSocket> socket) { |
171 client_callback_.OnDone(error); | 172 client_callback_.OnDone(error); |
172 client_socket_ = std::move(socket); | 173 client_socket_ = std::move(socket); |
173 } | 174 } |
174 | 175 |
175 } // namespace protocol | 176 } // namespace protocol |
176 } // namespace remoting | 177 } // namespace remoting |
OLD | NEW |