OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/message_loop_proxy.h" | 6 #include "base/message_loop_proxy.h" |
7 #include "base/time.h" | 7 #include "base/time.h" |
8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
9 #include "net/socket/socket.h" | 9 #include "net/socket/socket.h" |
10 #include "net/socket/stream_socket.h" | 10 #include "net/socket/stream_socket.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 InSequence dummy; | 186 InSequence dummy; |
187 | 187 |
188 if (expect_fail) { | 188 if (expect_fail) { |
189 EXPECT_CALL(host_connection_callback_, | 189 EXPECT_CALL(host_connection_callback_, |
190 OnStateChange(Session::FAILED)) | 190 OnStateChange(Session::FAILED)) |
191 .Times(1) | 191 .Times(1) |
192 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); | 192 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); |
193 } else { | 193 } else { |
194 EXPECT_CALL(host_connection_callback_, | 194 EXPECT_CALL(host_connection_callback_, |
195 OnStateChange(Session::CONNECTED)) | 195 OnStateChange(Session::CONNECTED)) |
| 196 .Times(1); |
| 197 EXPECT_CALL(host_connection_callback_, |
| 198 OnStateChange(Session::AUTHENTICATED)) |
196 .Times(1) | 199 .Times(1) |
197 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); | 200 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); |
198 // Expect that the connection will be closed eventually. | 201 // Expect that the connection will be closed eventually. |
199 EXPECT_CALL(host_connection_callback_, | 202 EXPECT_CALL(host_connection_callback_, |
200 OnStateChange(Session::CLOSED)) | 203 OnStateChange(Session::CLOSED)) |
201 .Times(AtMost(1)); | 204 .Times(AtMost(1)); |
202 } | 205 } |
203 } | 206 } |
204 | 207 |
205 { | 208 { |
206 InSequence dummy; | 209 InSequence dummy; |
207 | 210 |
208 EXPECT_CALL(client_connection_callback_, | 211 EXPECT_CALL(client_connection_callback_, |
209 OnStateChange(Session::CONNECTING)) | 212 OnStateChange(Session::CONNECTING)) |
210 .Times(1); | 213 .Times(1); |
211 if (!expect_fail) { | 214 if (!expect_fail) { |
212 EXPECT_CALL(client_connection_callback_, | 215 EXPECT_CALL(client_connection_callback_, |
213 OnStateChange(Session::CONNECTED)) | 216 OnStateChange(Session::CONNECTED)) |
| 217 .Times(1); |
| 218 EXPECT_CALL(client_connection_callback_, |
| 219 OnStateChange(Session::AUTHENTICATED)) |
214 .Times(1) | 220 .Times(1) |
215 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); | 221 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); |
216 } | 222 } |
217 // Expect that the connection will be closed eventually. | 223 // Expect that the connection will be closed eventually. |
218 EXPECT_CALL(client_connection_callback_, | 224 EXPECT_CALL(client_connection_callback_, |
219 OnStateChange(Session::CLOSED)) | 225 OnStateChange(Session::CLOSED)) |
220 .Times(AtMost(1)); | 226 .Times(AtMost(1)); |
221 } | 227 } |
222 | 228 |
223 Authenticator* authenticator = new FakeAuthenticator( | 229 Authenticator* authenticator = new FakeAuthenticator( |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 CreateServerPair(FakeAuthenticator::ACCEPT, 1); | 442 CreateServerPair(FakeAuthenticator::ACCEPT, 1); |
437 | 443 |
438 RunSpeedTest(512); | 444 RunSpeedTest(512); |
439 RunSpeedTest(1024); | 445 RunSpeedTest(1024); |
440 RunSpeedTest(51200); | 446 RunSpeedTest(51200); |
441 RunSpeedTest(512000); | 447 RunSpeedTest(512000); |
442 } | 448 } |
443 | 449 |
444 } // namespace protocol | 450 } // namespace protocol |
445 } // namespace remoting | 451 } // namespace remoting |
OLD | NEW |