Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: net/socket/socket_test_util.h

Issue 10795012: Modify DeterministicSocketData to verify that the sequence number of reads and writes start at zero… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sleevi's comments Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 void VerifyCorrectSequenceNumbers();
222
220 private: 223 private:
221 MockRead* reads_; 224 MockRead* reads_;
222 size_t read_index_; 225 size_t read_index_;
223 size_t read_count_; 226 size_t read_count_;
224 MockWrite* writes_; 227 MockWrite* writes_;
225 size_t write_index_; 228 size_t write_index_;
226 size_t write_count_; 229 size_t write_count_;
227 230
228 DISALLOW_COPY_AND_ASSIGN(StaticSocketDataProvider); 231 DISALLOW_COPY_AND_ASSIGN(StaticSocketDataProvider);
229 }; 232 };
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 1050
1048 extern const char kSOCKS5OkRequest[]; 1051 extern const char kSOCKS5OkRequest[];
1049 extern const int kSOCKS5OkRequestLength; 1052 extern const int kSOCKS5OkRequestLength;
1050 1053
1051 extern const char kSOCKS5OkResponse[]; 1054 extern const char kSOCKS5OkResponse[];
1052 extern const int kSOCKS5OkResponseLength; 1055 extern const int kSOCKS5OkResponseLength;
1053 1056
1054 } // namespace net 1057 } // namespace net
1055 1058
1056 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 1059 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698