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

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

Issue 3174004: Pass both hostname and port into SSLClientSocket (Closed)
Patch Set: Created 10 years, 4 months 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/socket_test_util.h ('k') | net/socket/ssl_client_socket_mac.h » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 10
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 delete this; 334 delete this;
335 } 335 }
336 336
337 MockSSLClientSocket* ssl_client_socket_; 337 MockSSLClientSocket* ssl_client_socket_;
338 net::CompletionCallback* user_callback_; 338 net::CompletionCallback* user_callback_;
339 int rv_; 339 int rv_;
340 }; 340 };
341 341
342 MockSSLClientSocket::MockSSLClientSocket( 342 MockSSLClientSocket::MockSSLClientSocket(
343 net::ClientSocketHandle* transport_socket, 343 net::ClientSocketHandle* transport_socket,
344 const std::string& hostname, 344 const HostPortPair& host_and_port,
345 const net::SSLConfig& ssl_config, 345 const net::SSLConfig& ssl_config,
346 net::SSLSocketDataProvider* data) 346 net::SSLSocketDataProvider* data)
347 : MockClientSocket(transport_socket->socket()->NetLog().net_log()), 347 : MockClientSocket(transport_socket->socket()->NetLog().net_log()),
348 transport_(transport_socket), 348 transport_(transport_socket),
349 data_(data), 349 data_(data),
350 is_npn_state_set_(false) { 350 is_npn_state_set_(false) {
351 DCHECK(data_); 351 DCHECK(data_);
352 } 352 }
353 353
354 MockSSLClientSocket::~MockSSLClientSocket() { 354 MockSSLClientSocket::~MockSSLClientSocket() {
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 SocketDataProvider* data_provider = mock_data_.GetNext(); 681 SocketDataProvider* data_provider = mock_data_.GetNext();
682 MockTCPClientSocket* socket = 682 MockTCPClientSocket* socket =
683 new MockTCPClientSocket(addresses, net_log, data_provider); 683 new MockTCPClientSocket(addresses, net_log, data_provider);
684 data_provider->set_socket(socket); 684 data_provider->set_socket(socket);
685 tcp_client_sockets_.push_back(socket); 685 tcp_client_sockets_.push_back(socket);
686 return socket; 686 return socket;
687 } 687 }
688 688
689 SSLClientSocket* MockClientSocketFactory::CreateSSLClientSocket( 689 SSLClientSocket* MockClientSocketFactory::CreateSSLClientSocket(
690 ClientSocketHandle* transport_socket, 690 ClientSocketHandle* transport_socket,
691 const std::string& hostname, 691 const HostPortPair& host_port_pair,
692 const SSLConfig& ssl_config) { 692 const SSLConfig& ssl_config) {
693 MockSSLClientSocket* socket = 693 MockSSLClientSocket* socket =
694 new MockSSLClientSocket(transport_socket, hostname, ssl_config, 694 new MockSSLClientSocket(transport_socket, host_port_pair, ssl_config,
695 mock_ssl_data_.GetNext()); 695 mock_ssl_data_.GetNext());
696 ssl_client_sockets_.push_back(socket); 696 ssl_client_sockets_.push_back(socket);
697 return socket; 697 return socket;
698 } 698 }
699 699
700 int TestSocketRequest::WaitForResult() { 700 int TestSocketRequest::WaitForResult() {
701 return callback_.WaitForResult(); 701 return callback_.WaitForResult();
702 } 702 }
703 703
704 void TestSocketRequest::RunWithParams(const Tuple1<int>& params) { 704 void TestSocketRequest::RunWithParams(const Tuple1<int>& params) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 900
901 const char kSOCKS5OkRequest[] = 901 const char kSOCKS5OkRequest[] =
902 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 }; 902 { 0x05, 0x01, 0x00, 0x03, 0x04, 'h', 'o', 's', 't', 0x00, 0x50 };
903 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest); 903 const int kSOCKS5OkRequestLength = arraysize(kSOCKS5OkRequest);
904 904
905 const char kSOCKS5OkResponse[] = 905 const char kSOCKS5OkResponse[] =
906 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 }; 906 { 0x05, 0x00, 0x00, 0x01, 127, 0, 0, 1, 0x00, 0x50 };
907 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse); 907 const int kSOCKS5OkResponseLength = arraysize(kSOCKS5OkResponse);
908 908
909 } // namespace net 909 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/ssl_client_socket_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698