| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ | 5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ | 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <cstring> | 9 #include <cstring> |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 DISALLOW_COPY_AND_ASSIGN(DynamicSocketDataProvider); | 240 DISALLOW_COPY_AND_ASSIGN(DynamicSocketDataProvider); |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 // SSLSocketDataProviders only need to keep track of the return code from calls | 243 // SSLSocketDataProviders only need to keep track of the return code from calls |
| 244 // to Connect(). | 244 // to Connect(). |
| 245 struct SSLSocketDataProvider { | 245 struct SSLSocketDataProvider { |
| 246 SSLSocketDataProvider(bool async, int result) | 246 SSLSocketDataProvider(bool async, int result) |
| 247 : connect(async, result), | 247 : connect(async, result), |
| 248 next_proto_status(SSLClientSocket::kNextProtoUnsupported), | 248 next_proto_status(SSLClientSocket::kNextProtoUnsupported), |
| 249 was_npn_negotiated(false), | 249 was_npn_negotiated(false), |
| 250 cert_request_info(NULL) { } | 250 cert_request_info(NULL), |
| 251 login_request_info(NULL) { } |
| 251 | 252 |
| 252 MockConnect connect; | 253 MockConnect connect; |
| 253 SSLClientSocket::NextProtoStatus next_proto_status; | 254 SSLClientSocket::NextProtoStatus next_proto_status; |
| 254 std::string next_proto; | 255 std::string next_proto; |
| 255 bool was_npn_negotiated; | 256 bool was_npn_negotiated; |
| 256 net::SSLCertRequestInfo* cert_request_info; | 257 net::SSLCertRequestInfo* cert_request_info; |
| 258 net::AuthChallengeInfo* login_request_info; |
| 257 }; | 259 }; |
| 258 | 260 |
| 259 // A DataProvider where the client must write a request before the reads (e.g. | 261 // A DataProvider where the client must write a request before the reads (e.g. |
| 260 // the response) will complete. | 262 // the response) will complete. |
| 261 class DelayedSocketData : public StaticSocketDataProvider, | 263 class DelayedSocketData : public StaticSocketDataProvider, |
| 262 public base::RefCounted<DelayedSocketData> { | 264 public base::RefCounted<DelayedSocketData> { |
| 263 public: | 265 public: |
| 264 // |write_delay| the number of MockWrites to complete before allowing | 266 // |write_delay| the number of MockWrites to complete before allowing |
| 265 // a MockRead to complete. | 267 // a MockRead to complete. |
| 266 // |reads| the list of MockRead completions. | 268 // |reads| the list of MockRead completions. |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 | 950 |
| 949 extern const char kSOCKS5OkRequest[]; | 951 extern const char kSOCKS5OkRequest[]; |
| 950 extern const int kSOCKS5OkRequestLength; | 952 extern const int kSOCKS5OkRequestLength; |
| 951 | 953 |
| 952 extern const char kSOCKS5OkResponse[]; | 954 extern const char kSOCKS5OkResponse[]; |
| 953 extern const int kSOCKS5OkResponseLength; | 955 extern const int kSOCKS5OkResponseLength; |
| 954 | 956 |
| 955 } // namespace net | 957 } // namespace net |
| 956 | 958 |
| 957 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 959 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| OLD | NEW |