| 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_security_key_ipc_client.h" | 5 #include "remoting/host/security_key/fake_security_key_ipc_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 channel_event_callback_.Run(); | 102 channel_event_callback_.Run(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void FakeSecurityKeyIpcClient::OnInvalidSession() { | 105 void FakeSecurityKeyIpcClient::OnInvalidSession() { |
| 106 invalid_session_error_ = true; | 106 invalid_session_error_ = true; |
| 107 channel_event_callback_.Run(); | 107 channel_event_callback_.Run(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void FakeSecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) { | 110 void FakeSecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) { |
| 111 ipc_channel_connected_ = true; | 111 ipc_channel_connected_ = true; |
| 112 channel_event_callback_.Run(); | 112 |
| 113 // We don't always want to fire this event as only a subset of tests care |
| 114 // about the channel being connected. Tests that do care can register for it. |
| 115 if (on_channel_connected_callback_) { |
| 116 on_channel_connected_callback_.Run(); |
| 117 } |
| 113 } | 118 } |
| 114 | 119 |
| 115 void FakeSecurityKeyIpcClient::OnChannelError() { | 120 void FakeSecurityKeyIpcClient::OnChannelError() { |
| 116 ipc_channel_connected_ = false; | 121 ipc_channel_connected_ = false; |
| 117 channel_event_callback_.Run(); | 122 channel_event_callback_.Run(); |
| 118 } | 123 } |
| 119 | 124 |
| 120 void FakeSecurityKeyIpcClient::OnSecurityKeyResponse( | 125 void FakeSecurityKeyIpcClient::OnSecurityKeyResponse( |
| 121 const std::string& request_data) { | 126 const std::string& request_data) { |
| 122 last_message_received_ = request_data; | 127 last_message_received_ = request_data; |
| 123 channel_event_callback_.Run(); | 128 channel_event_callback_.Run(); |
| 124 } | 129 } |
| 125 | 130 |
| 126 } // namespace remoting | 131 } // namespace remoting |
| OLD | NEW |