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/socket_test_util.h" | 5 #include "net/socket/socket_test_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 } | 795 } |
796 | 796 |
797 scoped_ptr<SSLClientSocket> MockClientSocketFactory::CreateSSLClientSocket( | 797 scoped_ptr<SSLClientSocket> MockClientSocketFactory::CreateSSLClientSocket( |
798 scoped_ptr<ClientSocketHandle> transport_socket, | 798 scoped_ptr<ClientSocketHandle> transport_socket, |
799 const HostPortPair& host_and_port, | 799 const HostPortPair& host_and_port, |
800 const SSLConfig& ssl_config, | 800 const SSLConfig& ssl_config, |
801 const SSLClientSocketContext& context) { | 801 const SSLClientSocketContext& context) { |
802 SSLSocketDataProvider* next_ssl_data = mock_ssl_data_.GetNext(); | 802 SSLSocketDataProvider* next_ssl_data = mock_ssl_data_.GetNext(); |
803 if (!next_ssl_data->next_protos_expected_in_ssl_config.empty()) { | 803 if (!next_ssl_data->next_protos_expected_in_ssl_config.empty()) { |
804 EXPECT_EQ(next_ssl_data->next_protos_expected_in_ssl_config.size(), | 804 EXPECT_EQ(next_ssl_data->next_protos_expected_in_ssl_config.size(), |
805 ssl_config.next_protos.size()); | 805 ssl_config.alpn_protos.size()); |
806 EXPECT_TRUE( | 806 EXPECT_TRUE( |
807 std::equal(next_ssl_data->next_protos_expected_in_ssl_config.begin(), | 807 std::equal(next_ssl_data->next_protos_expected_in_ssl_config.begin(), |
808 next_ssl_data->next_protos_expected_in_ssl_config.end(), | 808 next_ssl_data->next_protos_expected_in_ssl_config.end(), |
809 ssl_config.next_protos.begin())); | 809 ssl_config.alpn_protos.begin())); |
810 } | 810 } |
811 return scoped_ptr<SSLClientSocket>(new MockSSLClientSocket( | 811 return scoped_ptr<SSLClientSocket>(new MockSSLClientSocket( |
812 transport_socket.Pass(), host_and_port, ssl_config, next_ssl_data)); | 812 transport_socket.Pass(), host_and_port, ssl_config, next_ssl_data)); |
813 } | 813 } |
814 | 814 |
815 void MockClientSocketFactory::ClearSSLSessionCache() { | 815 void MockClientSocketFactory::ClearSSLSessionCache() { |
816 } | 816 } |
817 | 817 |
818 const char MockClientSocket::kTlsUnique[] = "MOCK_TLSUNIQ"; | 818 const char MockClientSocket::kTlsUnique[] = "MOCK_TLSUNIQ"; |
819 | 819 |
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 } | 2065 } |
2066 | 2066 |
2067 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { | 2067 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { |
2068 int64_t total = 0; | 2068 int64_t total = 0; |
2069 for (const MockWrite* write = writes; write != writes + writes_size; ++write) | 2069 for (const MockWrite* write = writes; write != writes + writes_size; ++write) |
2070 total += write->data_len; | 2070 total += write->data_len; |
2071 return total; | 2071 return total; |
2072 } | 2072 } |
2073 | 2073 |
2074 } // namespace net | 2074 } // namespace net |
OLD | NEW |