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

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

Issue 10824238: [net/dns] Don't abandon a DnsUDPAttempt when the response does not match the query. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 3 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
« no previous file with comments | « net/dns/dns_transaction_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 }; 304 };
305 305
306 // A DataProvider where the client must write a request before the reads (e.g. 306 // A DataProvider where the client must write a request before the reads (e.g.
307 // the response) will complete. 307 // the response) will complete.
308 class DelayedSocketData : public StaticSocketDataProvider { 308 class DelayedSocketData : public StaticSocketDataProvider {
309 public: 309 public:
310 // |write_delay| the number of MockWrites to complete before allowing 310 // |write_delay| the number of MockWrites to complete before allowing
311 // a MockRead to complete. 311 // a MockRead to complete.
312 // |reads| the list of MockRead completions. 312 // |reads| the list of MockRead completions.
313 // |writes| the list of MockWrite completions. 313 // |writes| the list of MockWrite completions.
314 // Note: All MockReads and MockWrites must be async.
315 // Note: For stream sockets, the MockRead list must end with a EOF, e.g., a 314 // Note: For stream sockets, the MockRead list must end with a EOF, e.g., a
316 // MockRead(true, 0, 0); 315 // MockRead(true, 0, 0);
317 DelayedSocketData(int write_delay, 316 DelayedSocketData(int write_delay,
318 MockRead* reads, size_t reads_count, 317 MockRead* reads, size_t reads_count,
319 MockWrite* writes, size_t writes_count); 318 MockWrite* writes, size_t writes_count);
320 319
321 // |connect| the result for the connect phase. 320 // |connect| the result for the connect phase.
322 // |reads| the list of MockRead completions. 321 // |reads| the list of MockRead completions.
323 // |write_delay| the number of MockWrites to complete before allowing 322 // |write_delay| the number of MockWrites to complete before allowing
324 // a MockRead to complete. 323 // a MockRead to complete.
325 // |writes| the list of MockWrite completions. 324 // |writes| the list of MockWrite completions.
326 // Note: All MockReads and MockWrites must be async.
327 // Note: For stream sockets, the MockRead list must end with a EOF, e.g., a 325 // Note: For stream sockets, the MockRead list must end with a EOF, e.g., a
328 // MockRead(true, 0, 0); 326 // MockRead(true, 0, 0);
329 DelayedSocketData(const MockConnect& connect, int write_delay, 327 DelayedSocketData(const MockConnect& connect, int write_delay,
330 MockRead* reads, size_t reads_count, 328 MockRead* reads, size_t reads_count,
331 MockWrite* writes, size_t writes_count); 329 MockWrite* writes, size_t writes_count);
332 virtual ~DelayedSocketData(); 330 virtual ~DelayedSocketData();
333 331
334 void ForceNextRead(); 332 void ForceNextRead();
335 333
336 // StaticSocketDataProvider: 334 // StaticSocketDataProvider:
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 1069
1072 extern const char kSOCKS5OkRequest[]; 1070 extern const char kSOCKS5OkRequest[];
1073 extern const int kSOCKS5OkRequestLength; 1071 extern const int kSOCKS5OkRequestLength;
1074 1072
1075 extern const char kSOCKS5OkResponse[]; 1073 extern const char kSOCKS5OkResponse[];
1076 extern const int kSOCKS5OkResponseLength; 1074 extern const int kSOCKS5OkResponseLength;
1077 1075
1078 } // namespace net 1076 } // namespace net
1079 1077
1080 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 1078 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/dns/dns_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698