| 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/security_key_extension_session.h" | 5 #include "remoting/host/security_key/security_key_extension_session.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 TestClientStub client_stub_; | 163 TestClientStub client_stub_; |
| 164 TestClientSessionDetails client_details_; | 164 TestClientSessionDetails client_details_; |
| 165 | 165 |
| 166 private: | 166 private: |
| 167 DISALLOW_COPY_AND_ASSIGN(SecurityKeyExtensionSessionTest); | 167 DISALLOW_COPY_AND_ASSIGN(SecurityKeyExtensionSessionTest); |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 SecurityKeyExtensionSessionTest::SecurityKeyExtensionSessionTest() | 170 SecurityKeyExtensionSessionTest::SecurityKeyExtensionSessionTest() |
| 171 : security_key_extension_session_( | 171 : security_key_extension_session_( |
| 172 new SecurityKeyExtensionSession(&client_details_, &client_stub_)) { | 172 new SecurityKeyExtensionSession(&client_details_, |
| 173 &client_stub_, |
| 174 /*file_task_runner=*/nullptr)) { |
| 173 // We want to retain ownership of mock object so we can use it to inject | 175 // We want to retain ownership of mock object so we can use it to inject |
| 174 // events into the extension session. The mock object should not be used | 176 // events into the extension session. The mock object should not be used |
| 175 // once |security_key_extension_session_| is destroyed. | 177 // once |security_key_extension_session_| is destroyed. |
| 176 mock_security_key_auth_handler_ = new MockSecurityKeyAuthHandler(); | 178 mock_security_key_auth_handler_ = new MockSecurityKeyAuthHandler(); |
| 177 security_key_extension_session_->SetSecurityKeyAuthHandlerForTesting( | 179 security_key_extension_session_->SetSecurityKeyAuthHandlerForTesting( |
| 178 base::WrapUnique(mock_security_key_auth_handler_)); | 180 base::WrapUnique(mock_security_key_auth_handler_)); |
| 179 } | 181 } |
| 180 | 182 |
| 181 SecurityKeyExtensionSessionTest::~SecurityKeyExtensionSessionTest() {} | 183 SecurityKeyExtensionSessionTest::~SecurityKeyExtensionSessionTest() {} |
| 182 | 184 |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 mock_security_key_auth_handler_->GetSendMessageCallback().Run(42, "test_msg"); | 443 mock_security_key_auth_handler_->GetSendMessageCallback().Run(42, "test_msg"); |
| 442 | 444 |
| 443 client_stub_.WaitForDeliverHostMessage( | 445 client_stub_.WaitForDeliverHostMessage( |
| 444 base::TimeDelta::FromMilliseconds(500)); | 446 base::TimeDelta::FromMilliseconds(500)); |
| 445 | 447 |
| 446 // Expects a JSON array of the ASCII character codes for "test_msg". | 448 // Expects a JSON array of the ASCII character codes for "test_msg". |
| 447 client_stub_.CheckHostDataMessage(42, "[116,101,115,116,95,109,115,103]"); | 449 client_stub_.CheckHostDataMessage(42, "[116,101,115,116,95,109,115,103]"); |
| 448 } | 450 } |
| 449 | 451 |
| 450 } // namespace remoting | 452 } // namespace remoting |
| OLD | NEW |