| 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 #ifndef REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_SERVER_H_ | 5 #ifndef REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_SERVER_H_ |
| 6 #define REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_SERVER_H_ | 6 #define REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_SERVER_H_ |
| 7 | 7 |
| 8 #include "remoting/host/security_key/security_key_ipc_server.h" | 8 #include "remoting/host/security_key/security_key_ipc_server.h" |
| 9 | 9 |
| 10 #include <cstdint> | 10 #include <cstdint> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 bool CreateChannel(const mojo::edk::NamedPlatformHandle& channel_handle, | 43 bool CreateChannel(const mojo::edk::NamedPlatformHandle& channel_handle, |
| 44 base::TimeDelta request_timeout) override; | 44 base::TimeDelta request_timeout) override; |
| 45 bool SendResponse(const std::string& message_data) override; | 45 bool SendResponse(const std::string& message_data) override; |
| 46 | 46 |
| 47 // Simulates receipt of a security key request message. | 47 // Simulates receipt of a security key request message. |
| 48 void SendRequest(const std::string& message_data); | 48 void SendRequest(const std::string& message_data); |
| 49 | 49 |
| 50 // Simulates the IPC channel being closed. | 50 // Simulates the IPC channel being closed. |
| 51 void CloseChannel(); | 51 void CloseChannel(); |
| 52 | 52 |
| 53 // Sends a ConnectionReady message to the client. |
| 54 void SendConnectionReadyMessage(); |
| 55 |
| 56 // Sends an InvalidSession message to the client. |
| 57 void SendInvalidSessionMessage(); |
| 58 |
| 53 // Returns a WeakPtr reference to this instance. | 59 // Returns a WeakPtr reference to this instance. |
| 54 base::WeakPtr<FakeSecurityKeyIpcServer> AsWeakPtr(); | 60 base::WeakPtr<FakeSecurityKeyIpcServer> AsWeakPtr(); |
| 55 | 61 |
| 56 // Returns the payload for the last message received. | 62 // Returns the payload for the last message received. |
| 57 const std::string& last_message_received() const { | 63 const std::string& last_message_received() const { |
| 58 return last_message_received_; | 64 return last_message_received_; |
| 59 } | 65 } |
| 60 | 66 |
| 61 // Signaled when a security key response message is received. | 67 // Signaled when a security key response message is received. |
| 62 // NOTE: Ths callback will be used instead of the IPC channel for response | 68 // NOTE: Ths callback will be used instead of the IPC channel for response |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // Tracks each FakeSecurityKeyIpcServer instance created by this | 129 // Tracks each FakeSecurityKeyIpcServer instance created by this |
| 124 // factory which allows them to be retrieved and queried for tests. | 130 // factory which allows them to be retrieved and queried for tests. |
| 125 std::map<int, base::WeakPtr<FakeSecurityKeyIpcServer>> ipc_server_map_; | 131 std::map<int, base::WeakPtr<FakeSecurityKeyIpcServer>> ipc_server_map_; |
| 126 | 132 |
| 127 DISALLOW_COPY_AND_ASSIGN(FakeSecurityKeyIpcServerFactory); | 133 DISALLOW_COPY_AND_ASSIGN(FakeSecurityKeyIpcServerFactory); |
| 128 }; | 134 }; |
| 129 | 135 |
| 130 } // namespace remoting | 136 } // namespace remoting |
| 131 | 137 |
| 132 #endif // REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_SERVER_H_ | 138 #endif // REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_SERVER_H_ |
| OLD | NEW |