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