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 <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "net/base/auth.h" | 23 #include "net/base/auth.h" |
24 #include "net/base/ip_address.h" | 24 #include "net/base/ip_address.h" |
25 #include "net/base/load_timing_info.h" | 25 #include "net/base/load_timing_info.h" |
26 #include "net/http/http_network_session.h" | 26 #include "net/http/http_network_session.h" |
27 #include "net/http/http_request_headers.h" | 27 #include "net/http/http_request_headers.h" |
28 #include "net/http/http_response_headers.h" | 28 #include "net/http/http_response_headers.h" |
29 #include "net/socket/socket.h" | 29 #include "net/socket/socket.h" |
30 #include "net/socket/websocket_endpoint_lock_manager.h" | 30 #include "net/socket/websocket_endpoint_lock_manager.h" |
31 #include "net/ssl/ssl_cert_request_info.h" | 31 #include "net/ssl/ssl_cert_request_info.h" |
32 #include "net/ssl/ssl_connection_status_flags.h" | 32 #include "net/ssl/ssl_connection_status_flags.h" |
33 #include "net/ssl/ssl_failure_state.h" | |
34 #include "net/ssl/ssl_info.h" | 33 #include "net/ssl/ssl_info.h" |
35 #include "testing/gtest/include/gtest/gtest.h" | 34 #include "testing/gtest/include/gtest/gtest.h" |
36 | 35 |
37 #define NET_TRACE(level, s) VLOG(level) << s << __FUNCTION__ << "() " | 36 #define NET_TRACE(level, s) VLOG(level) << s << __FUNCTION__ << "() " |
38 | 37 |
39 namespace net { | 38 namespace net { |
40 namespace { | 39 namespace { |
41 | 40 |
42 inline char AsciifyHigh(char x) { | 41 inline char AsciifyHigh(char x) { |
43 char nybble = static_cast<char>((x >> 4) & 0x0F); | 42 char nybble = static_cast<char>((x >> 4) & 0x0F); |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 std::vector<uint8_t>* out) { | 833 std::vector<uint8_t>* out) { |
835 NOTREACHED(); | 834 NOTREACHED(); |
836 return ERR_NOT_IMPLEMENTED; | 835 return ERR_NOT_IMPLEMENTED; |
837 } | 836 } |
838 | 837 |
839 crypto::ECPrivateKey* MockClientSocket::GetChannelIDKey() const { | 838 crypto::ECPrivateKey* MockClientSocket::GetChannelIDKey() const { |
840 NOTREACHED(); | 839 NOTREACHED(); |
841 return NULL; | 840 return NULL; |
842 } | 841 } |
843 | 842 |
844 SSLFailureState MockClientSocket::GetSSLFailureState() const { | |
845 return IsConnected() ? SSL_FAILURE_NONE : SSL_FAILURE_UNKNOWN; | |
846 } | |
847 | |
848 SSLClientSocket::NextProtoStatus MockClientSocket::GetNextProto( | 843 SSLClientSocket::NextProtoStatus MockClientSocket::GetNextProto( |
849 std::string* proto) const { | 844 std::string* proto) const { |
850 proto->clear(); | 845 proto->clear(); |
851 return SSLClientSocket::kNextProtoUnsupported; | 846 return SSLClientSocket::kNextProtoUnsupported; |
852 } | 847 } |
853 | 848 |
854 MockClientSocket::~MockClientSocket() {} | 849 MockClientSocket::~MockClientSocket() {} |
855 | 850 |
856 void MockClientSocket::RunCallbackAsync(const CompletionCallback& callback, | 851 void MockClientSocket::RunCallbackAsync(const CompletionCallback& callback, |
857 int result) { | 852 int result) { |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 } | 1730 } |
1736 | 1731 |
1737 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { | 1732 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size) { |
1738 int64_t total = 0; | 1733 int64_t total = 0; |
1739 for (const MockWrite* write = writes; write != writes + writes_size; ++write) | 1734 for (const MockWrite* write = writes; write != writes + writes_size; ++write) |
1740 total += write->data_len; | 1735 total += write->data_len; |
1741 return total; | 1736 return total; |
1742 } | 1737 } |
1743 | 1738 |
1744 } // namespace net | 1739 } // namespace net |
OLD | NEW |