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 "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "net/base/address_list.h" | 9 #include "net/base/address_list.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 // they'll give up waiting for application data and send the Finished after a | 533 // they'll give up waiting for application data and send the Finished after a |
534 // timeout. This means that an SSL connect end event may appear as a socket | 534 // timeout. This means that an SSL connect end event may appear as a socket |
535 // write. | 535 // write. |
536 static bool LogContainsSSLConnectEndEvent( | 536 static bool LogContainsSSLConnectEndEvent( |
537 const CapturingNetLog::CapturedEntryList& log, | 537 const CapturingNetLog::CapturedEntryList& log, |
538 int i) { | 538 int i) { |
539 return LogContainsEndEvent(log, i, NetLog::TYPE_SSL_CONNECT) || | 539 return LogContainsEndEvent(log, i, NetLog::TYPE_SSL_CONNECT) || |
540 LogContainsEvent( | 540 LogContainsEvent( |
541 log, i, NetLog::TYPE_SOCKET_BYTES_SENT, NetLog::PHASE_NONE); | 541 log, i, NetLog::TYPE_SOCKET_BYTES_SENT, NetLog::PHASE_NONE); |
542 } | 542 } |
543 ; | |
544 | 543 |
545 TEST_F(SSLClientSocketTest, Connect) { | 544 TEST_F(SSLClientSocketTest, Connect) { |
546 SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS, | 545 SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTPS, |
547 SpawnedTestServer::kLocalhost, | 546 SpawnedTestServer::kLocalhost, |
548 base::FilePath()); | 547 base::FilePath()); |
549 ASSERT_TRUE(test_server.Start()); | 548 ASSERT_TRUE(test_server.Start()); |
550 | 549 |
551 AddressList addr; | 550 AddressList addr; |
552 ASSERT_TRUE(test_server.GetAddressList(&addr)); | 551 ASSERT_TRUE(test_server.GetAddressList(&addr)); |
553 | 552 |
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 log.GetEntries(&entries); | 1946 log.GetEntries(&entries); |
1948 EXPECT_TRUE(LogContainsSSLConnectEndEvent(entries, -1)); | 1947 EXPECT_TRUE(LogContainsSSLConnectEndEvent(entries, -1)); |
1949 | 1948 |
1950 EXPECT_FALSE(sock->signed_cert_timestamps_received_); | 1949 EXPECT_FALSE(sock->signed_cert_timestamps_received_); |
1951 | 1950 |
1952 sock->Disconnect(); | 1951 sock->Disconnect(); |
1953 EXPECT_FALSE(sock->IsConnected()); | 1952 EXPECT_FALSE(sock->IsConnected()); |
1954 } | 1953 } |
1955 | 1954 |
1956 } // namespace net | 1955 } // namespace net |
OLD | NEW |