| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // channel socket. | 91 // channel socket. |
| 92 // TODO(sergeyu): Use MockSession to verify that no data is written? | 92 // TODO(sergeyu): Use MockSession to verify that no data is written? |
| 93 message_loop_.RunAllPending(); | 93 message_loop_.RunAllPending(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 TEST_F(ConnectionToClientTest, StateChange) { | 96 TEST_F(ConnectionToClientTest, StateChange) { |
| 97 EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get())); | 97 EXPECT_CALL(handler_, OnConnectionClosed(viewer_.get())); |
| 98 session_->state_change_callback().Run(protocol::Session::CLOSED); | 98 session_->state_change_callback().Run(protocol::Session::CLOSED); |
| 99 message_loop_.RunAllPending(); | 99 message_loop_.RunAllPending(); |
| 100 | 100 |
| 101 EXPECT_CALL(handler_, OnConnectionFailed(viewer_.get())); | 101 EXPECT_CALL(handler_, OnConnectionFailed( |
| 102 viewer_.get(), Session::SESSION_REJECTED)); |
| 103 session_->set_error(Session::SESSION_REJECTED); |
| 102 session_->state_change_callback().Run(protocol::Session::FAILED); | 104 session_->state_change_callback().Run(protocol::Session::FAILED); |
| 103 message_loop_.RunAllPending(); | 105 message_loop_.RunAllPending(); |
| 104 } | 106 } |
| 105 | 107 |
| 106 } // namespace protocol | 108 } // namespace protocol |
| 107 } // namespace remoting | 109 } // namespace remoting |
| OLD | NEW |