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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 } // namespace | 53 } // namespace |
54 | 54 |
55 class SecurityKeyAuthHandlerPosixTest : public testing::Test { | 55 class SecurityKeyAuthHandlerPosixTest : public testing::Test { |
56 public: | 56 public: |
57 SecurityKeyAuthHandlerPosixTest() | 57 SecurityKeyAuthHandlerPosixTest() |
58 : run_loop_(new base::RunLoop()), | 58 : run_loop_(new base::RunLoop()), |
59 file_thread_("SecurityKeyAuthHandlerPosixTest_FileThread") { | 59 file_thread_("SecurityKeyAuthHandlerPosixTest_FileThread") { |
60 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); | 60 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); |
61 socket_path_ = temp_dir_.path().Append(kSocketFilename); | 61 socket_path_ = temp_dir_.GetPath().Append(kSocketFilename); |
62 remoting::SecurityKeyAuthHandler::SetSecurityKeySocketName(socket_path_); | 62 remoting::SecurityKeyAuthHandler::SetSecurityKeySocketName(socket_path_); |
63 | 63 |
64 EXPECT_TRUE(file_thread_.StartWithOptions( | 64 EXPECT_TRUE(file_thread_.StartWithOptions( |
65 base::Thread::Options(base::MessageLoop::TYPE_IO, 0))); | 65 base::Thread::Options(base::MessageLoop::TYPE_IO, 0))); |
66 | 66 |
67 send_message_callback_ = | 67 send_message_callback_ = |
68 base::Bind(&SecurityKeyAuthHandlerPosixTest::SendMessageToClient, | 68 base::Bind(&SecurityKeyAuthHandlerPosixTest::SendMessageToClient, |
69 base::Unretained(this)); | 69 base::Unretained(this)); |
70 | 70 |
71 auth_handler_ = remoting::SecurityKeyAuthHandler::Create( | 71 auth_handler_ = remoting::SecurityKeyAuthHandler::Create( |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 net::UnixDomainClientSocket client_socket(socket_path_.value(), false); | 258 net::UnixDomainClientSocket client_socket(socket_path_.value(), false); |
259 net::TestCompletionCallback connect_callback; | 259 net::TestCompletionCallback connect_callback; |
260 int rv = client_socket.Connect(connect_callback.callback()); | 260 int rv = client_socket.Connect(connect_callback.callback()); |
261 ASSERT_EQ(net::OK, connect_callback.GetResult(rv)); | 261 ASSERT_EQ(net::OK, connect_callback.GetResult(rv)); |
262 | 262 |
263 auth_handler_->SendErrorAndCloseConnection(1); | 263 auth_handler_->SendErrorAndCloseConnection(1); |
264 ASSERT_EQ(0u, auth_handler_->GetActiveConnectionCountForTest()); | 264 ASSERT_EQ(0u, auth_handler_->GetActiveConnectionCountForTest()); |
265 } | 265 } |
266 | 266 |
267 } // namespace remoting | 267 } // namespace remoting |
OLD | NEW |