| 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.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 Loading... |
| 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 |
| OLD | NEW |