| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 337 TEST_F(HttpResponseBodyDrainerTest, DrainBodyCantReuse) { | 337 TEST_F(HttpResponseBodyDrainerTest, DrainBodyCantReuse) { | 
| 338   mock_stream_->set_num_chunks(1); | 338   mock_stream_->set_num_chunks(1); | 
| 339   mock_stream_->set_can_reuse_connection(false); | 339   mock_stream_->set_can_reuse_connection(false); | 
| 340   drainer_->Start(session_.get()); | 340   drainer_->Start(session_.get()); | 
| 341   EXPECT_TRUE(result_waiter_.WaitForResult()); | 341   EXPECT_TRUE(result_waiter_.WaitForResult()); | 
| 342 } | 342 } | 
| 343 | 343 | 
| 344 }  // namespace | 344 }  // namespace | 
| 345 | 345 | 
| 346 }  // namespace net | 346 }  // namespace net | 
| OLD | NEW | 
|---|