| 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/ssl_client_socket.h" | 5 #include "net/socket/ssl_client_socket.h" |
| 6 | 6 |
| 7 #include "net/base/address_list.h" | 7 #include "net/base/address_list.h" |
| 8 #include "net/base/cert_verifier.h" | 8 #include "net/base/cert_verifier.h" |
| 9 #include "net/base/host_resolver.h" | 9 #include "net/base/host_resolver.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "testing/platform_test.h" | 22 #include "testing/platform_test.h" |
| 23 | 23 |
| 24 //----------------------------------------------------------------------------- | 24 //----------------------------------------------------------------------------- |
| 25 | 25 |
| 26 const net::SSLConfig kDefaultSSLConfig; | 26 const net::SSLConfig kDefaultSSLConfig; |
| 27 | 27 |
| 28 class SSLClientSocketTest : public PlatformTest { | 28 class SSLClientSocketTest : public PlatformTest { |
| 29 public: | 29 public: |
| 30 SSLClientSocketTest() | 30 SSLClientSocketTest() |
| 31 : socket_factory_(net::ClientSocketFactory::GetDefaultFactory()), | 31 : socket_factory_(net::ClientSocketFactory::GetDefaultFactory()), |
| 32 cert_verifier_(new net::CertVerifier) { | 32 cert_verifier_(net::CertVerifier::CreateDefaultCertVerifier()) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 net::SSLClientSocket* CreateSSLClientSocket( | 36 net::SSLClientSocket* CreateSSLClientSocket( |
| 37 net::StreamSocket* transport_socket, | 37 net::StreamSocket* transport_socket, |
| 38 const net::HostPortPair& host_and_port, | 38 const net::HostPortPair& host_and_port, |
| 39 const net::SSLConfig& ssl_config) { | 39 const net::SSLConfig& ssl_config) { |
| 40 net::SSLClientSocketContext context; | 40 net::SSLClientSocketContext context; |
| 41 context.cert_verifier = cert_verifier_.get(); | 41 context.cert_verifier = cert_verifier_.get(); |
| 42 return socket_factory_->CreateSSLClientSocket(transport_socket, | 42 return socket_factory_->CreateSSLClientSocket(transport_socket, |
| (...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 if (rv == net::ERR_IO_PENDING) | 769 if (rv == net::ERR_IO_PENDING) |
| 770 rv = callback.WaitForResult(); | 770 rv = callback.WaitForResult(); |
| 771 EXPECT_EQ(net::OK, rv); | 771 EXPECT_EQ(net::OK, rv); |
| 772 } | 772 } |
| 773 | 773 |
| 774 // Verifies that SSLClientSocket::ClearSessionCache can be called without | 774 // Verifies that SSLClientSocket::ClearSessionCache can be called without |
| 775 // explicit NSS initialization. | 775 // explicit NSS initialization. |
| 776 TEST(SSLClientSocket, ClearSessionCache) { | 776 TEST(SSLClientSocket, ClearSessionCache) { |
| 777 net::SSLClientSocket::ClearSessionCache(); | 777 net::SSLClientSocket::ClearSessionCache(); |
| 778 } | 778 } |
| OLD | NEW |