| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 EXPECT_TRUE(net::LogContainsBeginEvent( | 293 EXPECT_TRUE(net::LogContainsBeginEvent( |
| 294 entries, 5, net::NetLog::TYPE_SSL_CONNECT)); | 294 entries, 5, net::NetLog::TYPE_SSL_CONNECT)); |
| 295 if (rv == net::ERR_IO_PENDING) | 295 if (rv == net::ERR_IO_PENDING) |
| 296 rv = callback.WaitForResult(); | 296 rv = callback.WaitForResult(); |
| 297 | 297 |
| 298 EXPECT_EQ(net::OK, rv); | 298 EXPECT_EQ(net::OK, rv); |
| 299 EXPECT_TRUE(sock->IsConnected()); | 299 EXPECT_TRUE(sock->IsConnected()); |
| 300 log.GetEntries(&entries); | 300 log.GetEntries(&entries); |
| 301 EXPECT_TRUE(LogContainsSSLConnectEndEvent(entries, -1)); | 301 EXPECT_TRUE(LogContainsSSLConnectEndEvent(entries, -1)); |
| 302 | 302 |
| 303 net::SSLInfo ssl_info; |
| 304 sock->GetSSLInfo(&ssl_info); |
| 305 EXPECT_FALSE(ssl_info.client_cert_sent); |
| 306 |
| 303 sock->Disconnect(); | 307 sock->Disconnect(); |
| 304 EXPECT_FALSE(sock->IsConnected()); | 308 EXPECT_FALSE(sock->IsConnected()); |
| 305 } | 309 } |
| 306 | 310 |
| 307 // TODO(wtc): Add unit tests for IsConnectedAndIdle: | 311 // TODO(wtc): Add unit tests for IsConnectedAndIdle: |
| 308 // - Server closes an SSL connection (with a close_notify alert message). | 312 // - Server closes an SSL connection (with a close_notify alert message). |
| 309 // - Server closes the underlying TCP connection directly. | 313 // - Server closes the underlying TCP connection directly. |
| 310 // - Server sends data unexpectedly. | 314 // - Server sends data unexpectedly. |
| 311 | 315 |
| 312 TEST_F(SSLClientSocketTest, Read) { | 316 TEST_F(SSLClientSocketTest, Read) { |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 socket_factory_->CreateSSLClientSocket( | 739 socket_factory_->CreateSSLClientSocket( |
| 736 socket_handle, test_server.host_port_pair(), kDefaultSSLConfig, | 740 socket_handle, test_server.host_port_pair(), kDefaultSSLConfig, |
| 737 NULL, context)); | 741 NULL, context)); |
| 738 | 742 |
| 739 EXPECT_FALSE(ssl_socket->IsConnected()); | 743 EXPECT_FALSE(ssl_socket->IsConnected()); |
| 740 rv = ssl_socket->Connect(&callback); | 744 rv = ssl_socket->Connect(&callback); |
| 741 if (rv == net::ERR_IO_PENDING) | 745 if (rv == net::ERR_IO_PENDING) |
| 742 rv = callback.WaitForResult(); | 746 rv = callback.WaitForResult(); |
| 743 EXPECT_EQ(net::OK, rv); | 747 EXPECT_EQ(net::OK, rv); |
| 744 } | 748 } |
| OLD | NEW |