| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 /* host_resolver */, | 178 NULL /* host_resolver */, |
| 179 NULL /* dnsrr_resolver */, | 179 NULL /* dnsrr_resolver */, |
| 180 NULL /* dns_cert_checker */, | 180 NULL /* dns_cert_checker */, |
| 181 NULL, |
| 181 NULL /* ssl_host_info_factory */, | 182 NULL /* ssl_host_info_factory */, |
| 182 ProxyService::CreateDirect(), | 183 ProxyService::CreateDirect(), |
| 183 NULL, | 184 NULL, |
| 184 new SSLConfigServiceDefaults, | 185 new SSLConfigServiceDefaults, |
| 185 new SpdySessionPool(NULL), | 186 new SpdySessionPool(NULL), |
| 186 NULL, | 187 NULL, |
| 187 NULL, | 188 NULL, |
| 188 NULL)), | 189 NULL)), |
| 189 mock_stream_(new MockHttpStream(&result_waiter_)), | 190 mock_stream_(new MockHttpStream(&result_waiter_)), |
| 190 drainer_(new HttpResponseBodyDrainer(mock_stream_)) {} | 191 drainer_(new HttpResponseBodyDrainer(mock_stream_)) {} |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 too_many_chunks += 1; // Now it's too large. | 237 too_many_chunks += 1; // Now it's too large. |
| 237 | 238 |
| 238 mock_stream_->set_num_chunks(too_many_chunks); | 239 mock_stream_->set_num_chunks(too_many_chunks); |
| 239 drainer_->Start(session_); | 240 drainer_->Start(session_); |
| 240 EXPECT_TRUE(result_waiter_.WaitForResult()); | 241 EXPECT_TRUE(result_waiter_.WaitForResult()); |
| 241 } | 242 } |
| 242 | 243 |
| 243 } // namespace | 244 } // namespace |
| 244 | 245 |
| 245 } // namespace net | 246 } // namespace net |
| OLD | NEW |