Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: net/http/http_response_body_drainer_unittest.cc

Issue 7289006: Basic HTTP pipelining support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better Close() handling and tests Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 {} 120 virtual void LogNumRttVsBytesMetrics() const OVERRIDE {}
121 121
122 virtual void Drain(HttpNetworkSession*) OVERRIDE {}
123
122 // Methods to tweak/observer mock behavior: 124 // Methods to tweak/observer mock behavior:
123 void StallReadsForever() { stall_reads_forever_ = true; } 125 void StallReadsForever() { stall_reads_forever_ = true; }
124 126
125 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; } 127 void set_num_chunks(int num_chunks) { num_chunks_ = num_chunks; }
126 128
127 private: 129 private:
128 void CompleteRead(); 130 void CompleteRead();
129 131
130 bool closed() const { return closed_; } 132 bool closed() const { return closed_; }
131 133
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 too_many_chunks += 1; // Now it's too large. 246 too_many_chunks += 1; // Now it's too large.
245 247
246 mock_stream_->set_num_chunks(too_many_chunks); 248 mock_stream_->set_num_chunks(too_many_chunks);
247 drainer_->Start(session_); 249 drainer_->Start(session_);
248 EXPECT_TRUE(result_waiter_.WaitForResult()); 250 EXPECT_TRUE(result_waiter_.WaitForResult());
249 } 251 }
250 252
251 } // namespace 253 } // namespace
252 254
253 } // namespace net 255 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698