| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 virtual HttpStream* RenewStreamForAuth() OVERRIDE { | 113 virtual HttpStream* RenewStreamForAuth() OVERRIDE { |
| 114 return NULL; | 114 return NULL; |
| 115 } | 115 } |
| 116 | 116 |
| 117 virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; } | 117 virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; } |
| 118 | 118 |
| 119 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } | 119 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } |
| 120 | 120 |
| 121 virtual void LogNumRttVsBytesMetrics() const OVERRIDE {} | 121 virtual void LogNumRttVsBytesMetrics() const OVERRIDE {} |
| 122 | 122 |
| 123 virtual void Drain(HttpNetworkSession*) OVERRIDE {} |
| 124 |
| 123 // Methods to tweak/observer mock behavior: | 125 // Methods to tweak/observer mock behavior: |
| 124 void StallReadsForever() { stall_reads_forever_ = true; } | 126 void StallReadsForever() { stall_reads_forever_ = true; } |
| 125 | 127 |
| 126 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; } | 128 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; } |
| 127 | 129 |
| 128 private: | 130 private: |
| 129 void CompleteRead(); | 131 void CompleteRead(); |
| 130 | 132 |
| 131 bool closed() const { return closed_; } | 133 bool closed() const { return closed_; } |
| 132 | 134 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 too_many_chunks += 1; // Now it's too large. | 250 too_many_chunks += 1; // Now it's too large. |
| 249 | 251 |
| 250 mock_stream_->set_num_chunks(too_many_chunks); | 252 mock_stream_->set_num_chunks(too_many_chunks); |
| 251 drainer_->Start(session_); | 253 drainer_->Start(session_); |
| 252 EXPECT_TRUE(result_waiter_.WaitForResult()); | 254 EXPECT_TRUE(result_waiter_.WaitForResult()); |
| 253 } | 255 } |
| 254 | 256 |
| 255 } // namespace | 257 } // namespace |
| 256 | 258 |
| 257 } // namespace net | 259 } // namespace net |
| OLD | NEW |