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

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

Issue 9567033: Cleanup error handling in the client plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/connection_to_host.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) 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.h" 6 #include "base/message_loop.h"
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "remoting/base/base_mock_objects.h" 8 #include "remoting/base/base_mock_objects.h"
9 #include "remoting/base/constants.h" 9 #include "remoting/base/constants.h"
10 #include "remoting/protocol/fake_session.h" 10 #include "remoting/protocol/fake_session.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 // channel socket. 93 // channel socket.
94 // TODO(sergeyu): Use MockSession to verify that no data is written? 94 // TODO(sergeyu): Use MockSession to verify that no data is written?
95 message_loop_.RunAllPending(); 95 message_loop_.RunAllPending();
96 } 96 }
97 97
98 TEST_F(ConnectionToClientTest, StateChange) { 98 TEST_F(ConnectionToClientTest, StateChange) {
99 EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get())); 99 EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get()));
100 session_->state_change_callback().Run(protocol::Session::CLOSED); 100 session_->state_change_callback().Run(protocol::Session::CLOSED);
101 message_loop_.RunAllPending(); 101 message_loop_.RunAllPending();
102 102
103 EXPECT_CALL(handler_, OnConnectionFailed( 103 EXPECT_CALL(handler_, OnConnectionFailed(viewer_.get(), SESSION_REJECTED));
104 viewer_.get(), Session::SESSION_REJECTED)); 104 session_->set_error(SESSION_REJECTED);
105 session_->set_error(Session::SESSION_REJECTED);
106 session_->state_change_callback().Run(protocol::Session::FAILED); 105 session_->state_change_callback().Run(protocol::Session::FAILED);
107 message_loop_.RunAllPending(); 106 message_loop_.RunAllPending();
108 } 107 }
109 108
110 } // namespace protocol 109 } // namespace protocol
111 } // namespace remoting 110 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698