OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 is_complete_ = true; | 170 is_complete_ = true; |
171 callback->Run(kMagicChunkSize); | 171 callback->Run(kMagicChunkSize); |
172 } | 172 } |
173 | 173 |
174 class HttpResponseBodyDrainerTest : public testing::Test { | 174 class HttpResponseBodyDrainerTest : public testing::Test { |
175 protected: | 175 protected: |
176 HttpResponseBodyDrainerTest() | 176 HttpResponseBodyDrainerTest() |
177 : session_(new HttpNetworkSession( | 177 : session_(new HttpNetworkSession( |
178 NULL, | 178 NULL, |
179 NULL, | 179 NULL, |
180 NULL /* ssl_host_info_factory */, | |
181 ProxyService::CreateDirect(), | 180 ProxyService::CreateDirect(), |
182 NULL, | 181 NULL, |
183 new SSLConfigServiceDefaults, | 182 new SSLConfigServiceDefaults, |
184 new SpdySessionPool(NULL), | 183 new SpdySessionPool(NULL), |
185 NULL, | 184 NULL, |
186 NULL, | 185 NULL, |
187 NULL)), | 186 NULL)), |
188 mock_stream_(new MockHttpStream(&result_waiter_)), | 187 mock_stream_(new MockHttpStream(&result_waiter_)), |
189 drainer_(new HttpResponseBodyDrainer(mock_stream_)) {} | 188 drainer_(new HttpResponseBodyDrainer(mock_stream_)) {} |
190 ~HttpResponseBodyDrainerTest() {} | 189 ~HttpResponseBodyDrainerTest() {} |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 too_many_chunks += 1; // Now it's too large. | 234 too_many_chunks += 1; // Now it's too large. |
236 | 235 |
237 mock_stream_->set_num_chunks(too_many_chunks); | 236 mock_stream_->set_num_chunks(too_many_chunks); |
238 drainer_->Start(session_); | 237 drainer_->Start(session_); |
239 EXPECT_TRUE(result_waiter_.WaitForResult()); | 238 EXPECT_TRUE(result_waiter_.WaitForResult()); |
240 } | 239 } |
241 | 240 |
242 } // namespace | 241 } // namespace |
243 | 242 |
244 } // namespace net | 243 } // namespace net |
OLD | NEW |