| 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 #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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // |reads| the list of MockRead completions. | 274 // |reads| the list of MockRead completions. |
| 275 // |write_delay| the number of MockWrites to complete before allowing | 275 // |write_delay| the number of MockWrites to complete before allowing |
| 276 // a MockRead to complete. | 276 // a MockRead to complete. |
| 277 // |writes| the list of MockWrite completions. | 277 // |writes| the list of MockWrite completions. |
| 278 // Note: All MockReads and MockWrites must be async. | 278 // Note: All MockReads and MockWrites must be async. |
| 279 // Note: The MockRead and MockWrite lists musts end with a EOF | 279 // Note: The MockRead and MockWrite lists musts end with a EOF |
| 280 // e.g. a MockRead(true, 0, 0); | 280 // e.g. a MockRead(true, 0, 0); |
| 281 DelayedSocketData(const MockConnect& connect, int write_delay, | 281 DelayedSocketData(const MockConnect& connect, int write_delay, |
| 282 MockRead* reads, size_t reads_count, | 282 MockRead* reads, size_t reads_count, |
| 283 MockWrite* writes, size_t writes_count); | 283 MockWrite* writes, size_t writes_count); |
| 284 ~DelayedSocketData(); | 284 virtual ~DelayedSocketData(); |
| 285 | 285 |
| 286 void ForceNextRead(); | 286 void ForceNextRead(); |
| 287 | 287 |
| 288 // StaticSocketDataProvider: | 288 // StaticSocketDataProvider: |
| 289 virtual MockRead GetNextRead(); | 289 virtual MockRead GetNextRead(); |
| 290 virtual MockWriteResult OnWrite(const std::string& data); | 290 virtual MockWriteResult OnWrite(const std::string& data); |
| 291 virtual void Reset(); | 291 virtual void Reset(); |
| 292 virtual void CompleteRead(); | 292 virtual void CompleteRead(); |
| 293 | 293 |
| 294 private: | 294 private: |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 | 951 |
| 952 extern const char kSOCKS5OkRequest[]; | 952 extern const char kSOCKS5OkRequest[]; |
| 953 extern const int kSOCKS5OkRequestLength; | 953 extern const int kSOCKS5OkRequestLength; |
| 954 | 954 |
| 955 extern const char kSOCKS5OkResponse[]; | 955 extern const char kSOCKS5OkResponse[]; |
| 956 extern const int kSOCKS5OkResponseLength; | 956 extern const int kSOCKS5OkResponseLength; |
| 957 | 957 |
| 958 } // namespace net | 958 } // namespace net |
| 959 | 959 |
| 960 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 960 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| OLD | NEW |