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