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 #include "net/http/http_response_body_drainer.h" | 5 #include "net/http/http_response_body_drainer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cstring> | 9 #include <cstring> |
10 | 10 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 is_sync_(false), | 83 is_sync_(false), |
84 is_last_chunk_zero_size_(false), | 84 is_last_chunk_zero_size_(false), |
85 is_complete_(false), | 85 is_complete_(false), |
86 can_reuse_connection_(true), | 86 can_reuse_connection_(true), |
87 weak_factory_(this) {} | 87 weak_factory_(this) {} |
88 ~MockHttpStream() override {} | 88 ~MockHttpStream() override {} |
89 | 89 |
90 // HttpStream implementation. | 90 // HttpStream implementation. |
91 int InitializeStream(const HttpRequestInfo* request_info, | 91 int InitializeStream(const HttpRequestInfo* request_info, |
92 RequestPriority priority, | 92 RequestPriority priority, |
93 const BoundNetLog& net_log, | 93 const NetLogWithSource& net_log, |
94 const CompletionCallback& callback) override { | 94 const CompletionCallback& callback) override { |
95 return ERR_UNEXPECTED; | 95 return ERR_UNEXPECTED; |
96 } | 96 } |
97 int SendRequest(const HttpRequestHeaders& request_headers, | 97 int SendRequest(const HttpRequestHeaders& request_headers, |
98 HttpResponseInfo* response, | 98 HttpResponseInfo* response, |
99 const CompletionCallback& callback) override { | 99 const CompletionCallback& callback) override { |
100 return ERR_UNEXPECTED; | 100 return ERR_UNEXPECTED; |
101 } | 101 } |
102 int ReadResponseHeaders(const CompletionCallback& callback) override { | 102 int ReadResponseHeaders(const CompletionCallback& callback) override { |
103 return ERR_UNEXPECTED; | 103 return ERR_UNEXPECTED; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 TEST_F(HttpResponseBodyDrainerTest, DrainBodyCantReuse) { | 336 TEST_F(HttpResponseBodyDrainerTest, DrainBodyCantReuse) { |
337 mock_stream_->set_num_chunks(1); | 337 mock_stream_->set_num_chunks(1); |
338 mock_stream_->set_can_reuse_connection(false); | 338 mock_stream_->set_can_reuse_connection(false); |
339 drainer_->Start(session_.get()); | 339 drainer_->Start(session_.get()); |
340 EXPECT_TRUE(result_waiter_.WaitForResult()); | 340 EXPECT_TRUE(result_waiter_.WaitForResult()); |
341 } | 341 } |
342 | 342 |
343 } // namespace | 343 } // namespace |
344 | 344 |
345 } // namespace net | 345 } // namespace net |
OLD | NEW |