Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Side by Side Diff: net/socket/socks_client_socket_unittest.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/socket/socks5_client_socket_unittest.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 entries, -1, NetLog::TYPE_SOCKS_CONNECT)); 280 entries, -1, NetLog::TYPE_SOCKS_CONNECT));
281 } 281 }
282 282
283 // Tests scenario when the client sends the handshake request in 283 // Tests scenario when the client sends the handshake request in
284 // more than one packet. 284 // more than one packet.
285 TEST_F(SOCKSClientSocketTest, PartialClientWrites) { 285 TEST_F(SOCKSClientSocketTest, PartialClientWrites) {
286 const char kSOCKSPartialRequest1[] = { 0x04, 0x01 }; 286 const char kSOCKSPartialRequest1[] = { 0x04, 0x01 };
287 const char kSOCKSPartialRequest2[] = { 0x00, 0x50, 127, 0, 0, 1, 0 }; 287 const char kSOCKSPartialRequest2[] = { 0x00, 0x50, 127, 0, 0, 1, 0 };
288 288
289 MockWrite data_writes[] = { 289 MockWrite data_writes[] = {
290 MockWrite(ASYNC, arraysize(kSOCKSPartialRequest1)), 290 MockWrite(ASYNC, kSOCKSPartialRequest1, arraysize(kSOCKSPartialRequest1)),
291 // simulate some empty writes 291 // simulate some empty writes
292 MockWrite(ASYNC, 0), 292 MockWrite(ASYNC, 0),
293 MockWrite(ASYNC, 0), 293 MockWrite(ASYNC, 0),
294 MockWrite(ASYNC, kSOCKSPartialRequest2, 294 MockWrite(ASYNC, kSOCKSPartialRequest2, arraysize(kSOCKSPartialRequest2)),
295 arraysize(kSOCKSPartialRequest2)) }; 295 };
296 MockRead data_reads[] = { 296 MockRead data_reads[] = {
297 MockRead(ASYNC, kSOCKSOkReply, arraysize(kSOCKSOkReply)) }; 297 MockRead(ASYNC, kSOCKSOkReply, arraysize(kSOCKSOkReply)) };
298 CapturingNetLog log; 298 CapturingNetLog log;
299 299
300 user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads), 300 user_sock_ = BuildMockSocket(data_reads, arraysize(data_reads),
301 data_writes, arraysize(data_writes), 301 data_writes, arraysize(data_writes),
302 host_resolver_.get(), 302 host_resolver_.get(),
303 "localhost", 80, 303 "localhost", 80,
304 &log); 304 &log);
305 305
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « net/socket/socks5_client_socket_unittest.cc ('k') | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698