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/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 .WillOnce(DoAll( | 342 .WillOnce(DoAll( |
343 WithArg<0>(Invoke( | 343 WithArg<0>(Invoke( |
344 this, &JingleSessionTest::SetHostSession)), | 344 this, &JingleSessionTest::SetHostSession)), |
345 SetArgumentPointee<1>(protocol::SessionManager::ACCEPT))); | 345 SetArgumentPointee<1>(protocol::SessionManager::ACCEPT))); |
346 | 346 |
347 { | 347 { |
348 InSequence dummy; | 348 InSequence dummy; |
349 | 349 |
350 EXPECT_CALL(host_connection_callback_, | 350 EXPECT_CALL(host_connection_callback_, |
351 OnStateChange(Session::CONNECTED)) | 351 OnStateChange(Session::CONNECTED)) |
| 352 .Times(1); |
| 353 EXPECT_CALL(host_connection_callback_, |
| 354 OnStateChange(Session::AUTHENTICATED)) |
352 .Times(1) | 355 .Times(1) |
353 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); | 356 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); |
354 // Expect that the connection will be closed eventually. | 357 // Expect that the connection will be closed eventually. |
355 EXPECT_CALL(host_connection_callback_, | 358 EXPECT_CALL(host_connection_callback_, |
356 OnStateChange(Session::CLOSED)) | 359 OnStateChange(Session::CLOSED)) |
357 .Times(AtMost(1)); | 360 .Times(AtMost(1)); |
358 } | 361 } |
359 | 362 |
360 { | 363 { |
361 InSequence dummy; | 364 InSequence dummy; |
362 | 365 |
363 EXPECT_CALL(client_connection_callback_, | 366 EXPECT_CALL(client_connection_callback_, |
364 OnStateChange(Session::CONNECTING)) | 367 OnStateChange(Session::CONNECTING)) |
365 .Times(1); | 368 .Times(1); |
366 EXPECT_CALL(client_connection_callback_, | 369 EXPECT_CALL(client_connection_callback_, |
367 OnStateChange(Session::CONNECTED)) | 370 OnStateChange(Session::CONNECTED)) |
| 371 .Times(1); |
| 372 EXPECT_CALL(client_connection_callback_, |
| 373 OnStateChange(Session::AUTHENTICATED)) |
368 .Times(1) | 374 .Times(1) |
369 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); | 375 .WillOnce(QuitThreadOnCounter(¬_connected_peers)); |
370 // Expect that the connection will be closed eventually. | 376 // Expect that the connection will be closed eventually. |
371 EXPECT_CALL(client_connection_callback_, | 377 EXPECT_CALL(client_connection_callback_, |
372 OnStateChange(Session::CLOSED)) | 378 OnStateChange(Session::CLOSED)) |
373 .Times(AtMost(1)); | 379 .Times(AtMost(1)); |
374 } | 380 } |
375 | 381 |
376 Authenticator* authenticator; | 382 Authenticator* authenticator; |
377 if (use_fake_auth) { | 383 if (use_fake_auth) { |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 ASSERT_TRUE(tester->WaitFinished()); | 913 ASSERT_TRUE(tester->WaitFinished()); |
908 LOG(INFO) << "Time for 500k bytes " | 914 LOG(INFO) << "Time for 500k bytes " |
909 << tester->GetElapsedTime().InMilliseconds() << " ms."; | 915 << tester->GetElapsedTime().InMilliseconds() << " ms."; |
910 | 916 |
911 // Connections must be closed while |tester| still exists. | 917 // Connections must be closed while |tester| still exists. |
912 CloseSessions(); | 918 CloseSessions(); |
913 } | 919 } |
914 | 920 |
915 } // namespace protocol | 921 } // namespace protocol |
916 } // namespace remoting | 922 } // namespace remoting |
OLD | NEW |