Chromium Code Reviews| 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 #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 | 7 |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <deque> | 9 #include <deque> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 bool at_read_eof() const { return read_index_ >= read_count_; } | 210 bool at_read_eof() const { return read_index_ >= read_count_; } |
| 211 bool at_write_eof() const { return write_index_ >= write_count_; } | 211 bool at_write_eof() const { return write_index_ >= write_count_; } |
| 212 | 212 |
| 213 virtual void CompleteRead() {} | 213 virtual void CompleteRead() {} |
| 214 | 214 |
| 215 // SocketDataProvider implementation. | 215 // SocketDataProvider implementation. |
| 216 virtual MockRead GetNextRead() OVERRIDE; | 216 virtual MockRead GetNextRead() OVERRIDE; |
| 217 virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE; | 217 virtual MockWriteResult OnWrite(const std::string& data) OVERRIDE; |
| 218 virtual void Reset() OVERRIDE; | 218 virtual void Reset() OVERRIDE; |
| 219 | 219 |
| 220 protected: | |
| 221 StaticSocketDataProvider(bool verify_sequence_numbers, | |
| 222 MockRead* reads, size_t reads_count, | |
| 223 MockWrite* writes, size_t writes_count); | |
|
Ryan Sleevi
2012/07/18 18:02:13
Is there a reason this isn't the default behaviour
Ryan Hamilton
2012/07/18 18:45:06
It's not the default behavior because StaticSocket
| |
| 224 | |
| 220 private: | 225 private: |
| 226 void VerifyCorrectSequenceNumbers(); | |
| 227 | |
| 221 MockRead* reads_; | 228 MockRead* reads_; |
| 222 size_t read_index_; | 229 size_t read_index_; |
| 223 size_t read_count_; | 230 size_t read_count_; |
| 224 MockWrite* writes_; | 231 MockWrite* writes_; |
| 225 size_t write_index_; | 232 size_t write_index_; |
| 226 size_t write_count_; | 233 size_t write_count_; |
| 227 | 234 |
| 228 DISALLOW_COPY_AND_ASSIGN(StaticSocketDataProvider); | 235 DISALLOW_COPY_AND_ASSIGN(StaticSocketDataProvider); |
| 229 }; | 236 }; |
| 230 | 237 |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1047 | 1054 |
| 1048 extern const char kSOCKS5OkRequest[]; | 1055 extern const char kSOCKS5OkRequest[]; |
| 1049 extern const int kSOCKS5OkRequestLength; | 1056 extern const int kSOCKS5OkRequestLength; |
| 1050 | 1057 |
| 1051 extern const char kSOCKS5OkResponse[]; | 1058 extern const char kSOCKS5OkResponse[]; |
| 1052 extern const int kSOCKS5OkResponseLength; | 1059 extern const int kSOCKS5OkResponseLength; |
| 1053 | 1060 |
| 1054 } // namespace net | 1061 } // namespace net |
| 1055 | 1062 |
| 1056 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 1063 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
| OLD | NEW |