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 REMOTING_PROTOCOL_CONNECTION_TESTER_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TESTER_H_ |
6 #define REMOTING_PROTOCOL_CONNECTION_TESTER_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TESTER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // end to the other. | 27 // end to the other. |
28 class StreamConnectionTester { | 28 class StreamConnectionTester { |
29 public: | 29 public: |
30 StreamConnectionTester(net::StreamSocket* client_socket, | 30 StreamConnectionTester(net::StreamSocket* client_socket, |
31 net::StreamSocket* host_socket, | 31 net::StreamSocket* host_socket, |
32 int message_size, | 32 int message_size, |
33 int message_count); | 33 int message_count); |
34 ~StreamConnectionTester(); | 34 ~StreamConnectionTester(); |
35 | 35 |
36 void Start(); | 36 void Start(); |
| 37 bool done() { return done_; } |
37 void CheckResults(); | 38 void CheckResults(); |
38 | 39 |
39 protected: | 40 protected: |
40 void Done(); | 41 void Done(); |
41 void InitBuffers(); | 42 void InitBuffers(); |
42 void DoWrite(); | 43 void DoWrite(); |
43 void OnWritten(int result); | 44 void OnWritten(int result); |
44 void HandleWriteResult(int result); | 45 void HandleWriteResult(int result); |
45 void DoRead(); | 46 void DoRead(); |
46 void OnRead(int result); | 47 void OnRead(int result); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 int read_errors_; | 98 int read_errors_; |
98 int packets_sent_; | 99 int packets_sent_; |
99 int packets_received_; | 100 int packets_received_; |
100 int bad_packets_received_; | 101 int bad_packets_received_; |
101 }; | 102 }; |
102 | 103 |
103 } // namespace protocol | 104 } // namespace protocol |
104 } // namespace remoting | 105 } // namespace remoting |
105 | 106 |
106 #endif // REMOTING_PROTOCOL_CONNECTION_TESTER_H_ | 107 #endif // REMOTING_PROTOCOL_CONNECTION_TESTER_H_ |
OLD | NEW |