| 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_CLIENT_H_ | 5 #ifndef REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_CLIENT_H_ |
| 6 #define REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_CLIENT_H_ | 6 #define REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // Override of SendSecurityKeyRequest() interface method for tests which use | 45 // Override of SendSecurityKeyRequest() interface method for tests which use |
| 46 // an IPC channel for testing. | 46 // an IPC channel for testing. |
| 47 void SendSecurityKeyRequestViaIpc(const std::string& request_payload); | 47 void SendSecurityKeyRequestViaIpc(const std::string& request_payload); |
| 48 | 48 |
| 49 base::WeakPtr<FakeRemoteSecurityKeyIpcClient> AsWeakPtr(); | 49 base::WeakPtr<FakeRemoteSecurityKeyIpcClient> AsWeakPtr(); |
| 50 | 50 |
| 51 const std::string& last_message_received() const { | 51 const std::string& last_message_received() const { |
| 52 return last_message_received_; | 52 return last_message_received_; |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool ipc_channel_connected() { return ipc_channel_connected_; } |
| 56 |
| 55 void set_wait_for_ipc_channel_return_value(bool return_value) { | 57 void set_wait_for_ipc_channel_return_value(bool return_value) { |
| 56 wait_for_ipc_channel_return_value_ = return_value; | 58 wait_for_ipc_channel_return_value_ = return_value; |
| 57 } | 59 } |
| 58 | 60 |
| 59 void set_establish_ipc_connection_should_succeed(bool should_succeed) { | 61 void set_establish_ipc_connection_should_succeed(bool should_succeed) { |
| 60 establish_ipc_connection_should_succeed_ = should_succeed; | 62 establish_ipc_connection_should_succeed_ = should_succeed; |
| 61 } | 63 } |
| 62 | 64 |
| 63 void set_send_security_request_should_succeed(bool should_succeed) { | 65 void set_send_security_request_should_succeed(bool should_succeed) { |
| 64 send_security_request_should_succeed_ = should_succeed; | 66 send_security_request_should_succeed_ = should_succeed; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 92 | 94 |
| 93 // Determines whether EstablishIpcConnection() returns success or failure. | 95 // Determines whether EstablishIpcConnection() returns success or failure. |
| 94 bool establish_ipc_connection_should_succeed_ = true; | 96 bool establish_ipc_connection_should_succeed_ = true; |
| 95 | 97 |
| 96 // Determines whether SendSecurityKeyRequest() returns success or failure. | 98 // Determines whether SendSecurityKeyRequest() returns success or failure. |
| 97 bool send_security_request_should_succeed_ = true; | 99 bool send_security_request_should_succeed_ = true; |
| 98 | 100 |
| 99 // Value returned by WaitForSecurityKeyIpcServerChannel() method. | 101 // Value returned by WaitForSecurityKeyIpcServerChannel() method. |
| 100 bool wait_for_ipc_channel_return_value_ = true; | 102 bool wait_for_ipc_channel_return_value_ = true; |
| 101 | 103 |
| 104 // Stores whether a connection to the server IPC channel is active. |
| 105 bool ipc_channel_connected_ = false; |
| 106 |
| 102 // Value returned by SendSecurityKeyRequest() method. | 107 // Value returned by SendSecurityKeyRequest() method. |
| 103 std::string security_key_response_payload_; | 108 std::string security_key_response_payload_; |
| 104 | 109 |
| 105 base::WeakPtrFactory<FakeRemoteSecurityKeyIpcClient> weak_factory_; | 110 base::WeakPtrFactory<FakeRemoteSecurityKeyIpcClient> weak_factory_; |
| 106 | 111 |
| 107 DISALLOW_COPY_AND_ASSIGN(FakeRemoteSecurityKeyIpcClient); | 112 DISALLOW_COPY_AND_ASSIGN(FakeRemoteSecurityKeyIpcClient); |
| 108 }; | 113 }; |
| 109 | 114 |
| 110 } // namespace remoting | 115 } // namespace remoting |
| 111 | 116 |
| 112 #endif // REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_CLIENT_H_ | 117 #endif // REMOTING_HOST_SECURITY_KEY_FAKE_SECURITY_KEY_IPC_CLIENT_H_ |
| OLD | NEW |