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/socks_client_socket.h" | 5 #include "net/socket/socks_client_socket.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "net/base/address_list.h" | 8 #include "net/base/address_list.h" |
9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
10 #include "net/base/net_log_unittest.h" | 10 #include "net/base/net_log_unittest.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 }, | 207 }, |
208 // Failure of the null byte | 208 // Failure of the null byte |
209 { | 209 { |
210 { 0x00, 0x5B, 0x00, 0x00, 0, 0, 0, 0 }, | 210 { 0x00, 0x5B, 0x00, 0x00, 0, 0, 0, 0 }, |
211 ERR_SOCKS_CONNECTION_FAILED, | 211 ERR_SOCKS_CONNECTION_FAILED, |
212 }, | 212 }, |
213 }; | 213 }; |
214 | 214 |
215 //--------------------------------------- | 215 //--------------------------------------- |
216 | 216 |
217 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 217 for (size_t i = 0; i < arraysize(tests); ++i) { |
218 MockWrite data_writes[] = { | 218 MockWrite data_writes[] = { |
219 MockWrite(SYNCHRONOUS, kSOCKSOkRequest, arraysize(kSOCKSOkRequest)) }; | 219 MockWrite(SYNCHRONOUS, kSOCKSOkRequest, arraysize(kSOCKSOkRequest)) }; |
220 MockRead data_reads[] = { | 220 MockRead data_reads[] = { |
221 MockRead(SYNCHRONOUS, tests[i].fail_reply, | 221 MockRead(SYNCHRONOUS, tests[i].fail_reply, |
222 arraysize(tests[i].fail_reply)) }; | 222 arraysize(tests[i].fail_reply)) }; |
223 CapturingNetLog log; | 223 CapturingNetLog log; |
224 | 224 |
225 user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), | 225 user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), |
226 data_writes, arraysize(data_writes), | 226 data_writes, arraysize(data_writes), |
227 host_resolver_.get(), | 227 host_resolver_.get(), |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 NULL, 0, | 441 NULL, 0, |
442 host_resolver.get(), | 442 host_resolver.get(), |
443 kHostName, 80, | 443 kHostName, 80, |
444 NULL); | 444 NULL); |
445 | 445 |
446 EXPECT_EQ(ERR_NAME_NOT_RESOLVED, | 446 EXPECT_EQ(ERR_NAME_NOT_RESOLVED, |
447 callback_.GetResult(user_sock_->Connect(callback_.callback()))); | 447 callback_.GetResult(user_sock_->Connect(callback_.callback()))); |
448 } | 448 } |
449 | 449 |
450 } // namespace net | 450 } // namespace net |
OLD | NEW |