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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 0x53, 0x83, 0x0a, 0xfc, 0x17, 0x63, 0xbf, 0xa0, 0xe4, 0x42, 0x90, 0x0d, | 609 0x53, 0x83, 0x0a, 0xfc, 0x17, 0x63, 0xbf, 0xa0, 0xe4, 0x42, 0x90, 0x0d, |
610 0x2f, 0x18, 0x6d, 0x20, 0xd8, 0x36, 0x3f, 0xfc, 0xe6, 0x01, 0xfa, 0x0f, | 610 0x2f, 0x18, 0x6d, 0x20, 0xd8, 0x36, 0x3f, 0xfc, 0xe6, 0x01, 0xfa, 0x0f, |
611 0xa5, 0x75, 0x7f, 0x09, 0x00, 0x04, 0x00, 0x16, 0x03, 0x01, 0x11, 0x57, | 611 0xa5, 0x75, 0x7f, 0x09, 0x00, 0x04, 0x00, 0x16, 0x03, 0x01, 0x11, 0x57, |
612 0x0b, 0x00, 0x11, 0x53, 0x00, 0x11, 0x50, 0x00, 0x06, 0x22, 0x30, 0x82, | 612 0x0b, 0x00, 0x11, 0x53, 0x00, 0x11, 0x50, 0x00, 0x06, 0x22, 0x30, 0x82, |
613 0x06, 0x1e, 0x30, 0x82, 0x05, 0x06, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, | 613 0x06, 0x1e, 0x30, 0x82, 0x05, 0x06, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, |
614 0x0a | 614 0x0a |
615 }; | 615 }; |
616 | 616 |
617 // All reads and writes complete synchronously (async=false). | 617 // All reads and writes complete synchronously (async=false). |
618 net::MockRead data_reads[] = { | 618 net::MockRead data_reads[] = { |
619 net::MockRead(false, reinterpret_cast<const char*>(application_data), | 619 net::MockRead(net::SYNCHRONOUS, |
| 620 reinterpret_cast<const char*>(application_data), |
620 arraysize(application_data)), | 621 arraysize(application_data)), |
621 net::MockRead(false, net::OK), | 622 net::MockRead(net::SYNCHRONOUS, net::OK), |
622 }; | 623 }; |
623 | 624 |
624 net::StaticSocketDataProvider data(data_reads, arraysize(data_reads), | 625 net::StaticSocketDataProvider data(data_reads, arraysize(data_reads), |
625 NULL, 0); | 626 NULL, 0); |
626 | 627 |
627 net::StreamSocket* transport = | 628 net::StreamSocket* transport = |
628 new net::MockTCPClientSocket(addr, NULL, &data); | 629 new net::MockTCPClientSocket(addr, NULL, &data); |
629 int rv = transport->Connect(callback.callback()); | 630 int rv = transport->Connect(callback.callback()); |
630 if (rv == net::ERR_IO_PENDING) | 631 if (rv == net::ERR_IO_PENDING) |
631 rv = callback.WaitForResult(); | 632 rv = callback.WaitForResult(); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 if (rv == net::ERR_IO_PENDING) | 753 if (rv == net::ERR_IO_PENDING) |
753 rv = callback.WaitForResult(); | 754 rv = callback.WaitForResult(); |
754 EXPECT_EQ(net::OK, rv); | 755 EXPECT_EQ(net::OK, rv); |
755 } | 756 } |
756 | 757 |
757 // Verifies that SSLClientSocket::ClearSessionCache can be called without | 758 // Verifies that SSLClientSocket::ClearSessionCache can be called without |
758 // explicit NSS initialization. | 759 // explicit NSS initialization. |
759 TEST(SSLClientSocket, ClearSessionCache) { | 760 TEST(SSLClientSocket, ClearSessionCache) { |
760 net::SSLClientSocket::ClearSessionCache(); | 761 net::SSLClientSocket::ClearSessionCache(); |
761 } | 762 } |
OLD | NEW |