| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/security_key/fake_ipc_gnubby_auth_handler.h" | 5 #include "remoting/host/security_key/fake_ipc_security_key_auth_handler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
| 11 #include "ipc/ipc_listener.h" | 11 #include "ipc/ipc_listener.h" |
| 12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
| 13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
| 14 #include "remoting/host/chromoting_messages.h" | 14 #include "remoting/host/chromoting_messages.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 namespace remoting { | 17 namespace remoting { |
| 18 | 18 |
| 19 FakeIpcGnubbyAuthHandler::FakeIpcGnubbyAuthHandler() {} | 19 FakeIpcSecurityKeyAuthHandler::FakeIpcSecurityKeyAuthHandler() {} |
| 20 | 20 |
| 21 FakeIpcGnubbyAuthHandler::~FakeIpcGnubbyAuthHandler() {} | 21 FakeIpcSecurityKeyAuthHandler::~FakeIpcSecurityKeyAuthHandler() {} |
| 22 | 22 |
| 23 void FakeIpcGnubbyAuthHandler::CreateGnubbyConnection() { | 23 void FakeIpcSecurityKeyAuthHandler::CreateSecurityKeyConnection() { |
| 24 ipc_server_channel_ = IPC::Channel::CreateNamedServer( | 24 ipc_server_channel_ = IPC::Channel::CreateNamedServer( |
| 25 IPC::ChannelHandle(ipc_server_channel_name_), this); | 25 IPC::ChannelHandle(ipc_server_channel_name_), this); |
| 26 ASSERT_NE(nullptr, ipc_server_channel_); | 26 ASSERT_NE(nullptr, ipc_server_channel_); |
| 27 ASSERT_TRUE(ipc_server_channel_->Connect()); | 27 ASSERT_TRUE(ipc_server_channel_->Connect()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 bool FakeIpcGnubbyAuthHandler::IsValidConnectionId(int connection_id) const { | 30 bool FakeIpcSecurityKeyAuthHandler::IsValidConnectionId( |
| 31 int connection_id) const { |
| 31 return false; | 32 return false; |
| 32 } | 33 } |
| 33 | 34 |
| 34 void FakeIpcGnubbyAuthHandler::SendClientResponse( | 35 void FakeIpcSecurityKeyAuthHandler::SendClientResponse( |
| 35 int connection_id, | 36 int connection_id, |
| 36 const std::string& response_data) {} | 37 const std::string& response_data) {} |
| 37 | 38 |
| 38 void FakeIpcGnubbyAuthHandler::SendErrorAndCloseConnection(int connection_id) {} | 39 void FakeIpcSecurityKeyAuthHandler::SendErrorAndCloseConnection( |
| 40 int connection_id) {} |
| 39 | 41 |
| 40 void FakeIpcGnubbyAuthHandler::SetSendMessageCallback( | 42 void FakeIpcSecurityKeyAuthHandler::SetSendMessageCallback( |
| 41 const SendMessageCallback& callback) {} | 43 const SendMessageCallback& callback) {} |
| 42 | 44 |
| 43 size_t FakeIpcGnubbyAuthHandler::GetActiveConnectionCountForTest() const { | 45 size_t FakeIpcSecurityKeyAuthHandler::GetActiveConnectionCountForTest() const { |
| 44 return 0; | 46 return 0; |
| 45 } | 47 } |
| 46 | 48 |
| 47 void FakeIpcGnubbyAuthHandler::SetRequestTimeoutForTest( | 49 void FakeIpcSecurityKeyAuthHandler::SetRequestTimeoutForTest( |
| 48 base::TimeDelta timeout) {} | 50 base::TimeDelta timeout) {} |
| 49 | 51 |
| 50 bool FakeIpcGnubbyAuthHandler::OnMessageReceived(const IPC::Message& message) { | 52 bool FakeIpcSecurityKeyAuthHandler::OnMessageReceived( |
| 53 const IPC::Message& message) { |
| 51 // This class does handle any IPC messages sent by the client. | 54 // This class does handle any IPC messages sent by the client. |
| 52 return false; | 55 return false; |
| 53 } | 56 } |
| 54 | 57 |
| 55 void FakeIpcGnubbyAuthHandler::OnChannelConnected(int32_t peer_pid) { | 58 void FakeIpcSecurityKeyAuthHandler::OnChannelConnected(int32_t peer_pid) { |
| 56 ASSERT_TRUE(ipc_server_channel_->Send( | 59 ASSERT_TRUE(ipc_server_channel_->Send( |
| 57 new ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionDetails( | 60 new ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionDetails( |
| 58 ipc_security_key_channel_name_))); | 61 ipc_security_key_channel_name_))); |
| 59 } | 62 } |
| 60 | 63 |
| 61 void FakeIpcGnubbyAuthHandler::OnChannelError() {} | 64 void FakeIpcSecurityKeyAuthHandler::OnChannelError() {} |
| 62 | 65 |
| 63 } // namespace remoting | 66 } // namespace remoting |
| OLD | NEW |