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 "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // Skip first four bytes and build up the response string. | 107 // Skip first four bytes and build up the response string. |
108 for (size_t i = 4; i < sizeof(kRequestData); ++i) { | 108 for (size_t i = 4; i < sizeof(kRequestData); ++i) { |
109 expected_data.append(1, static_cast<unsigned char>(kRequestData[i])); | 109 expected_data.append(1, static_cast<unsigned char>(kRequestData[i])); |
110 } | 110 } |
111 | 111 |
112 CheckHostDataMessage(connection_id, expected_data); | 112 CheckHostDataMessage(connection_id, expected_data); |
113 } | 113 } |
114 | 114 |
115 protected: | 115 protected: |
116 base::MessageLoopForIO message_loop_; | 116 base::MessageLoopForIO message_loop_; |
117 scoped_ptr<base::RunLoop> run_loop_; | 117 std::unique_ptr<base::RunLoop> run_loop_; |
118 | 118 |
119 // Object under test. | 119 // Object under test. |
120 scoped_ptr<GnubbyAuthHandler> auth_handler_; | 120 std::unique_ptr<GnubbyAuthHandler> auth_handler_; |
121 | 121 |
122 GnubbyAuthHandler::SendMessageCallback send_message_callback_; | 122 GnubbyAuthHandler::SendMessageCallback send_message_callback_; |
123 | 123 |
124 int last_connection_id_received_; | 124 int last_connection_id_received_; |
125 std::string last_message_received_; | 125 std::string last_message_received_; |
126 | 126 |
127 base::ScopedTempDir temp_dir_; | 127 base::ScopedTempDir temp_dir_; |
128 base::FilePath socket_path_; | 128 base::FilePath socket_path_; |
129 base::Closure accept_callback_; | 129 base::Closure accept_callback_; |
130 | 130 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 net::UnixDomainClientSocket client_socket(socket_path_.value(), false); | 238 net::UnixDomainClientSocket client_socket(socket_path_.value(), false); |
239 net::TestCompletionCallback connect_callback; | 239 net::TestCompletionCallback connect_callback; |
240 int rv = client_socket.Connect(connect_callback.callback()); | 240 int rv = client_socket.Connect(connect_callback.callback()); |
241 ASSERT_EQ(net::OK, connect_callback.GetResult(rv)); | 241 ASSERT_EQ(net::OK, connect_callback.GetResult(rv)); |
242 | 242 |
243 auth_handler_->SendErrorAndCloseConnection(1); | 243 auth_handler_->SendErrorAndCloseConnection(1); |
244 ASSERT_EQ(0u, auth_handler_->GetActiveConnectionCountForTest()); | 244 ASSERT_EQ(0u, auth_handler_->GetActiveConnectionCountForTest()); |
245 } | 245 } |
246 | 246 |
247 } // namespace remoting | 247 } // namespace remoting |
OLD | NEW |