OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "net/tools/quic/test_tools/simple_client.h" | |
6 | |
7 #include "net/tools/balsa/balsa_headers.h" | |
8 | |
9 namespace net { | |
10 namespace test { | |
11 | |
12 void SimpleClient::WaitForResponse() { | |
13 WaitForResponseForMs(-1); | |
14 } | |
15 | |
16 // Waits for some data or response from the server. | |
17 void SimpleClient::WaitForInitialResponse() { | |
18 WaitForInitialResponseForMs(-1); | |
19 } | |
20 | |
21 void SimpleClient::WaitForResponseForMs(int timeout_ms) { | |
22 WaitUntil(timeout_ms, [this]() { return response_complete(); }); | |
23 if (response_complete()) { | |
24 VLOG(1) << "Client received response:" << response_headers()->DebugString() | |
25 << response_body(); | |
26 } | |
27 } | |
28 | |
29 void SimpleClient::WaitForInitialResponseForMs(int timeout_ms) { | |
30 WaitUntil(timeout_ms, [this]() { return response_size() != 0; }); | |
31 } | |
32 | |
33 int SimpleClient::ResetSocket() { | |
34 LOG(FATAL) << "SimpleClient::ResetSocket is not implemented"; | |
35 return 0; | |
36 } | |
37 | |
38 int SimpleClient::HalfClose() { | |
39 LOG(FATAL) << "SimpleClient::HalfClose is not implemented"; | |
40 return 0; | |
41 } | |
42 | |
43 int SimpleClient::response_header_size() const { | |
44 return 0; | |
45 } | |
46 | |
47 int64_t SimpleClient::response_body_size() const { | |
48 return 0; | |
49 } | |
50 | |
51 } // namespace net | |
52 } // namespace test | |
OLD | NEW |