| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/socket/socks5_client_socket.h" | 5 #include "net/socket/socks5_client_socket.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // Domain string: | 251 // Domain string: |
| 252 'w', 'w', 'w', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o', 'm', | 252 'w', 'w', 'w', '.', 'g', 'o', 'o', 'g', 'l', 'e', '.', 'c', 'o', 'm', |
| 253 0x00, 0x50, // 16-bit port (80) | 253 0x00, 0x50, // 16-bit port (80) |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 // Test for partial greet request write | 256 // Test for partial greet request write |
| 257 { | 257 { |
| 258 const char partial1[] = { 0x05, 0x01 }; | 258 const char partial1[] = { 0x05, 0x01 }; |
| 259 const char partial2[] = { 0x00 }; | 259 const char partial2[] = { 0x00 }; |
| 260 MockWrite data_writes[] = { | 260 MockWrite data_writes[] = { |
| 261 MockWrite(ASYNC, arraysize(partial1)), | 261 MockWrite(ASYNC, partial1, arraysize(partial1)), |
| 262 MockWrite(ASYNC, partial2, arraysize(partial2)), | 262 MockWrite(ASYNC, partial2, arraysize(partial2)), |
| 263 MockWrite(ASYNC, kOkRequest, arraysize(kOkRequest)) }; | 263 MockWrite(ASYNC, kOkRequest, arraysize(kOkRequest)) }; |
| 264 MockRead data_reads[] = { | 264 MockRead data_reads[] = { |
| 265 MockRead(ASYNC, kSOCKS5GreetResponse, kSOCKS5GreetResponseLength), | 265 MockRead(ASYNC, kSOCKS5GreetResponse, kSOCKS5GreetResponseLength), |
| 266 MockRead(ASYNC, kSOCKS5OkResponse, kSOCKS5OkResponseLength) }; | 266 MockRead(ASYNC, kSOCKS5OkResponse, kSOCKS5OkResponseLength) }; |
| 267 user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), | 267 user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), |
| 268 data_writes, arraysize(data_writes), | 268 data_writes, arraysize(data_writes), |
| 269 hostname, 80, &net_log_); | 269 hostname, 80, &net_log_); |
| 270 int rv = user_sock_->Connect(callback_.callback()); | 270 int rv = user_sock_->Connect(callback_.callback()); |
| 271 EXPECT_EQ(ERR_IO_PENDING, rv); | 271 EXPECT_EQ(ERR_IO_PENDING, rv); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 EXPECT_TRUE(user_sock_->IsConnected()); | 370 EXPECT_TRUE(user_sock_->IsConnected()); |
| 371 net_log_.GetEntries(&net_log_entries); | 371 net_log_.GetEntries(&net_log_entries); |
| 372 EXPECT_TRUE(LogContainsEndEvent(net_log_entries, -1, | 372 EXPECT_TRUE(LogContainsEndEvent(net_log_entries, -1, |
| 373 NetLog::TYPE_SOCKS5_CONNECT)); | 373 NetLog::TYPE_SOCKS5_CONNECT)); |
| 374 } | 374 } |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace | 377 } // namespace |
| 378 | 378 |
| 379 } // namespace net | 379 } // namespace net |
| OLD | NEW |