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

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

Issue 1113203002: Convert DnsTransactionTest to use SequencedSocketData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 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
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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 MockWrite* writes, 493 MockWrite* writes,
494 size_t writes_count); 494 size_t writes_count);
495 495
496 ~SequencedSocketData() override; 496 ~SequencedSocketData() override;
497 497
498 // SocketDataProviderBase implementation. 498 // SocketDataProviderBase implementation.
499 MockRead OnRead() override; 499 MockRead OnRead() override;
500 MockWriteResult OnWrite(const std::string& data) override; 500 MockWriteResult OnWrite(const std::string& data) override;
501 void Reset() override; 501 void Reset() override;
502 502
503 // Returns true if any data was written to the socket, even if the write
504 // has not completed.
505 bool WasDataWritten() const;
506
503 // Returns true if all data has been read. 507 // Returns true if all data has been read.
504 bool at_read_eof() const; 508 bool at_read_eof() const;
505 509
506 // Returns true if all data has been written. 510 // Returns true if all data has been written.
507 bool at_write_eof() const; 511 bool at_write_eof() const;
508 512
509 private: 513 private:
510 // Defines the state for the read or write path. 514 // Defines the state for the read or write path.
511 enum IoState { 515 enum IoState {
512 IDLE, // No async operation is in progress. 516 IDLE, // No async operation is in progress.
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 1382
1379 extern const char kSOCKS5OkRequest[]; 1383 extern const char kSOCKS5OkRequest[];
1380 extern const int kSOCKS5OkRequestLength; 1384 extern const int kSOCKS5OkRequestLength;
1381 1385
1382 extern const char kSOCKS5OkResponse[]; 1386 extern const char kSOCKS5OkResponse[];
1383 extern const int kSOCKS5OkResponseLength; 1387 extern const int kSOCKS5OkResponseLength;
1384 1388
1385 } // namespace net 1389 } // namespace net
1386 1390
1387 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ 1391 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698