| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 virtual HttpStream* RenewStreamForAuth() OVERRIDE { | 112 virtual HttpStream* RenewStreamForAuth() OVERRIDE { |
| 113 return NULL; | 113 return NULL; |
| 114 } | 114 } |
| 115 | 115 |
| 116 virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; } | 116 virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; } |
| 117 | 117 |
| 118 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } | 118 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } |
| 119 | 119 |
| 120 virtual void LogNumRttVsBytesMetrics() const OVERRIDE {} | |
| 121 | |
| 122 // Methods to tweak/observer mock behavior: | 120 // Methods to tweak/observer mock behavior: |
| 123 void StallReadsForever() { stall_reads_forever_ = true; } | 121 void StallReadsForever() { stall_reads_forever_ = true; } |
| 124 | 122 |
| 125 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; } | 123 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; } |
| 126 | 124 |
| 127 private: | 125 private: |
| 128 void CompleteRead(); | 126 void CompleteRead(); |
| 129 | 127 |
| 130 bool closed() const { return closed_; } | 128 bool closed() const { return closed_; } |
| 131 | 129 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 too_many_chunks += 1; // Now it's too large. | 242 too_many_chunks += 1; // Now it's too large. |
| 245 | 243 |
| 246 mock_stream_->set_num_chunks(too_many_chunks); | 244 mock_stream_->set_num_chunks(too_many_chunks); |
| 247 drainer_->Start(session_); | 245 drainer_->Start(session_); |
| 248 EXPECT_TRUE(result_waiter_.WaitForResult()); | 246 EXPECT_TRUE(result_waiter_.WaitForResult()); |
| 249 } | 247 } |
| 250 | 248 |
| 251 } // namespace | 249 } // namespace |
| 252 | 250 |
| 253 } // namespace net | 251 } // namespace net |
| OLD | NEW |