| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/base/constants.h" | 5 #include "remoting/base/constants.h" |
| 6 #include "remoting/host/client_session.h" | 6 #include "remoting/host/client_session.h" |
| 7 #include "remoting/host/host_mock_objects.h" | 7 #include "remoting/host/host_mock_objects.h" |
| 8 #include "remoting/protocol/protocol_mock_objects.h" | 8 #include "remoting/protocol/protocol_mock_objects.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // Set up a large default screen size that won't affect most tests. | 32 // Set up a large default screen size that won't affect most tests. |
| 33 default_screen_size_.set(1000, 1000); | 33 default_screen_size_.set(1000, 1000); |
| 34 EXPECT_CALL(capturer_, size_most_recent()) | 34 EXPECT_CALL(capturer_, size_most_recent()) |
| 35 .WillRepeatedly(ReturnRef(default_screen_size_)); | 35 .WillRepeatedly(ReturnRef(default_screen_size_)); |
| 36 | 36 |
| 37 protocol::MockSession* session = new MockSession(); | 37 protocol::MockSession* session = new MockSession(); |
| 38 EXPECT_CALL(*session, jid()).WillRepeatedly(ReturnRef(client_jid_)); | 38 EXPECT_CALL(*session, jid()).WillRepeatedly(ReturnRef(client_jid_)); |
| 39 EXPECT_CALL(*session, SetStateChangeCallback(_)); | 39 EXPECT_CALL(*session, SetStateChangeCallback(_)); |
| 40 | 40 |
| 41 scoped_ptr<protocol::ConnectionToClient> connection( |
| 42 new protocol::ConnectionToClient(session)); |
| 41 client_session_.reset(new ClientSession( | 43 client_session_.reset(new ClientSession( |
| 42 &session_event_handler_, | 44 &session_event_handler_, connection.Pass(), |
| 43 new protocol::ConnectionToClient(session), | |
| 44 &host_event_stub_, &capturer_)); | 45 &host_event_stub_, &capturer_)); |
| 45 } | 46 } |
| 46 | 47 |
| 47 virtual void TearDown() OVERRIDE { | 48 virtual void TearDown() OVERRIDE { |
| 48 client_session_.reset(); | 49 client_session_.reset(); |
| 49 // Run message loop before destroying because protocol::Session is | 50 // Run message loop before destroying because protocol::Session is |
| 50 // destroyed asynchronously. | 51 // destroyed asynchronously. |
| 51 message_loop_.RunAllPending(); | 52 message_loop_.RunAllPending(); |
| 52 } | 53 } |
| 53 | 54 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 event.set_x(input_x[i]); | 239 event.set_x(input_x[i]); |
| 239 event.set_y(input_y[j]); | 240 event.set_y(input_y[j]); |
| 240 EXPECT_CALL(host_event_stub_, InjectMouseEvent(EqualsMouseEvent( | 241 EXPECT_CALL(host_event_stub_, InjectMouseEvent(EqualsMouseEvent( |
| 241 expected_x[i], expected_y[j]))); | 242 expected_x[i], expected_y[j]))); |
| 242 client_session_->InjectMouseEvent(event); | 243 client_session_->InjectMouseEvent(event); |
| 243 } | 244 } |
| 244 } | 245 } |
| 245 } | 246 } |
| 246 | 247 |
| 247 } // namespace remoting | 248 } // namespace remoting |
| OLD | NEW |