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 <cstring> | 7 #include <cstring> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 | 116 |
117 virtual HttpStream* RenewStreamForAuth() OVERRIDE { | 117 virtual HttpStream* RenewStreamForAuth() OVERRIDE { |
118 return NULL; | 118 return NULL; |
119 } | 119 } |
120 | 120 |
121 virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; } | 121 virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; } |
122 | 122 |
123 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } | 123 virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } |
124 | 124 |
125 virtual void LogNumRttVsBytesMetrics() const OVERRIDE {} | |
126 | |
127 virtual bool GetLoadTimingInfo( | 125 virtual bool GetLoadTimingInfo( |
128 LoadTimingInfo* load_timing_info) const OVERRIDE { return false; } | 126 LoadTimingInfo* load_timing_info) const OVERRIDE { return false; } |
129 | 127 |
130 virtual void Drain(HttpNetworkSession*) OVERRIDE {} | 128 virtual void Drain(HttpNetworkSession*) OVERRIDE {} |
131 | 129 |
132 // Methods to tweak/observer mock behavior: | 130 // Methods to tweak/observer mock behavior: |
133 void set_stall_reads_forever() { stall_reads_forever_ = true; } | 131 void set_stall_reads_forever() { stall_reads_forever_ = true; } |
134 | 132 |
135 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; } | 133 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; } |
136 | 134 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 314 |
317 TEST_F(HttpResponseBodyDrainerTest, StartWithNothingToDo) { | 315 TEST_F(HttpResponseBodyDrainerTest, StartWithNothingToDo) { |
318 mock_stream_->set_num_chunks(0); | 316 mock_stream_->set_num_chunks(0); |
319 drainer_->StartWithSize(session_, 0); | 317 drainer_->StartWithSize(session_, 0); |
320 EXPECT_FALSE(result_waiter_.WaitForResult()); | 318 EXPECT_FALSE(result_waiter_.WaitForResult()); |
321 } | 319 } |
322 | 320 |
323 } // namespace | 321 } // namespace |
324 | 322 |
325 } // namespace net | 323 } // namespace net |
OLD | NEW |