| OLD | NEW |
| 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/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/host_resolver.h" | 8 #include "net/base/host_resolver.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
| 11 #include "net/base/net_log_unittest.h" | 11 #include "net/base/net_log_unittest.h" |
| 12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 13 #include "net/base/ssl_config_service.h" | 13 #include "net/base/ssl_config_service.h" |
| 14 #include "net/base/test_completion_callback.h" | 14 #include "net/base/test_completion_callback.h" |
| 15 #include "net/socket/client_socket_factory.h" | 15 #include "net/socket/client_socket_factory.h" |
| 16 #include "net/socket/socket_test_util.h" | 16 #include "net/socket/socket_test_util.h" |
| 17 #include "net/socket/tcp_client_socket.h" | 17 #include "net/socket/tcp_client_socket.h" |
| 18 #include "net/test/test_server.h" | 18 #include "net/test/test_server.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "testing/platform_test.h" | 20 #include "testing/platform_test.h" |
| 21 | 21 |
| 22 //----------------------------------------------------------------------------- | 22 //----------------------------------------------------------------------------- |
| 23 | 23 |
| 24 const net::SSLConfig kDefaultSSLConfig; | 24 const net::SSLConfig kDefaultSSLConfig; |
| 25 | 25 |
| 26 class SSLClientSocketTest : public PlatformTest { | 26 class SSLClientSocketTest : public PlatformTest { |
| 27 public: | 27 public: |
| 28 SSLClientSocketTest() | 28 SSLClientSocketTest() |
| 29 : resolver_(net::CreateSystemHostResolver( | 29 : resolver_(net::CreateSystemHostResolver( |
| 30 net::HostResolver::kDefaultParallelism)), | 30 net::HostResolver::kDefaultParallelism, |
| 31 NULL)), |
| 31 socket_factory_(net::ClientSocketFactory::GetDefaultFactory()) { | 32 socket_factory_(net::ClientSocketFactory::GetDefaultFactory()) { |
| 32 } | 33 } |
| 33 | 34 |
| 34 protected: | 35 protected: |
| 35 scoped_refptr<net::HostResolver> resolver_; | 36 scoped_refptr<net::HostResolver> resolver_; |
| 36 net::ClientSocketFactory* socket_factory_; | 37 net::ClientSocketFactory* socket_factory_; |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 //----------------------------------------------------------------------------- | 40 //----------------------------------------------------------------------------- |
| 40 | 41 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 rv = callback.WaitForResult(); | 525 rv = callback.WaitForResult(); |
| 525 EXPECT_EQ(net::OK, rv); | 526 EXPECT_EQ(net::OK, rv); |
| 526 | 527 |
| 527 scoped_ptr<net::SSLClientSocket> sock( | 528 scoped_ptr<net::SSLClientSocket> sock( |
| 528 socket_factory_->CreateSSLClientSocket( | 529 socket_factory_->CreateSSLClientSocket( |
| 529 transport, test_server.host_port_pair().host(), kDefaultSSLConfig)); | 530 transport, test_server.host_port_pair().host(), kDefaultSSLConfig)); |
| 530 | 531 |
| 531 rv = sock->Connect(&callback); | 532 rv = sock->Connect(&callback); |
| 532 EXPECT_EQ(net::ERR_SSL_PROTOCOL_ERROR, rv); | 533 EXPECT_EQ(net::ERR_SSL_PROTOCOL_ERROR, rv); |
| 533 } | 534 } |
| OLD | NEW |