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

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

Issue 8774017: Add AUTHENTICATED session state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | remoting/protocol/pepper_session.cc » ('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) 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
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(&not_connected_peers)); 356 .WillOnce(QuitThreadOnCounter(&not_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(&not_connected_peers)); 375 .WillOnce(QuitThreadOnCounter(&not_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
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
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | remoting/protocol/pepper_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698