| 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 "remoting/host/client_session.h" | 5 #include "remoting/host/client_session.h" |
| 6 #include "remoting/host/host_mock_objects.h" | 6 #include "remoting/host/host_mock_objects.h" |
| 7 #include "remoting/protocol/protocol_mock_objects.h" | 7 #include "remoting/protocol/protocol_mock_objects.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace remoting { | 10 namespace remoting { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 using testing::_; | 27 using testing::_; |
| 28 using testing::DeleteArg; | 28 using testing::DeleteArg; |
| 29 using testing::InSequence; | 29 using testing::InSequence; |
| 30 using testing::Return; | 30 using testing::Return; |
| 31 | 31 |
| 32 class ClientSessionTest : public testing::Test { | 32 class ClientSessionTest : public testing::Test { |
| 33 public: | 33 public: |
| 34 ClientSessionTest() {} | 34 ClientSessionTest() {} |
| 35 | 35 |
| 36 virtual void SetUp() { | 36 virtual void SetUp() { |
| 37 connection_ = new MockConnectionToClient(&message_loop_, | 37 connection_ = new MockConnectionToClient( |
| 38 &connection_event_handler_, | 38 &connection_event_handler_, &host_stub_, &input_stub_); |
| 39 &host_stub_, | |
| 40 &input_stub_); | |
| 41 user_authenticator_ = new MockUserAuthenticator(); | 39 user_authenticator_ = new MockUserAuthenticator(); |
| 42 client_session_ = new ClientSession( | 40 client_session_ = new ClientSession( |
| 43 &session_event_handler_, | 41 &session_event_handler_, |
| 44 user_authenticator_, | 42 user_authenticator_, |
| 45 connection_, | 43 connection_, |
| 46 &input_stub_); | 44 &input_stub_); |
| 47 | 45 |
| 48 ON_CALL(input_stub_, InjectKeyEvent(_, _)).WillByDefault(DeleteArg<1>()); | 46 ON_CALL(input_stub_, InjectKeyEvent(_, _)).WillByDefault(DeleteArg<1>()); |
| 49 ON_CALL(input_stub_, InjectMouseEvent(_, _)).WillByDefault(DeleteArg<1>()); | 47 ON_CALL(input_stub_, InjectMouseEvent(_, _)).WillByDefault(DeleteArg<1>()); |
| 50 } | 48 } |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 client_session_->RecordKeyEvent(&key1); | 173 client_session_->RecordKeyEvent(&key1); |
| 176 client_session_->RecordKeyEvent(&key2); | 174 client_session_->RecordKeyEvent(&key2); |
| 177 | 175 |
| 178 EXPECT_CALL(input_stub_, InjectKeyEvent(IsMatchingKeyUp(&key1), _)); | 176 EXPECT_CALL(input_stub_, InjectKeyEvent(IsMatchingKeyUp(&key1), _)); |
| 179 EXPECT_CALL(input_stub_, InjectKeyEvent(IsMatchingKeyUp(&key2), _)); | 177 EXPECT_CALL(input_stub_, InjectKeyEvent(IsMatchingKeyUp(&key2), _)); |
| 180 | 178 |
| 181 client_session_->UnpressKeys(); | 179 client_session_->UnpressKeys(); |
| 182 } | 180 } |
| 183 | 181 |
| 184 } // namespace remoting | 182 } // namespace remoting |
| OLD | NEW |