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" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
15 #include "net/base/ssl_config_service_defaults.h" | |
16 #include "net/base/test_completion_callback.h" | 15 #include "net/base/test_completion_callback.h" |
17 #include "net/http/http_network_session.h" | 16 #include "net/http/http_network_session.h" |
18 #include "net/http/http_server_properties_impl.h" | 17 #include "net/http/http_server_properties_impl.h" |
19 #include "net/http/http_stream.h" | 18 #include "net/http/http_stream.h" |
20 #include "net/proxy/proxy_service.h" | 19 #include "net/proxy/proxy_service.h" |
| 20 #include "net/ssl/ssl_config_service_defaults.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
23 namespace net { | 23 namespace net { |
24 | 24 |
25 namespace { | 25 namespace { |
26 | 26 |
27 const int kMagicChunkSize = 1024; | 27 const int kMagicChunkSize = 1024; |
28 COMPILE_ASSERT( | 28 COMPILE_ASSERT( |
29 (HttpResponseBodyDrainer::kDrainBodyBufferSize % kMagicChunkSize) == 0, | 29 (HttpResponseBodyDrainer::kDrainBodyBufferSize % kMagicChunkSize) == 0, |
30 chunk_size_needs_to_divide_evenly_into_buffer_size); | 30 chunk_size_needs_to_divide_evenly_into_buffer_size); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 TEST_F(HttpResponseBodyDrainerTest, StartWithNothingToDo) { | 317 TEST_F(HttpResponseBodyDrainerTest, StartWithNothingToDo) { |
318 mock_stream_->set_num_chunks(0); | 318 mock_stream_->set_num_chunks(0); |
319 drainer_->StartWithSize(session_, 0); | 319 drainer_->StartWithSize(session_, 0); |
320 EXPECT_FALSE(result_waiter_.WaitForResult()); | 320 EXPECT_FALSE(result_waiter_.WaitForResult()); |
321 } | 321 } |
322 | 322 |
323 } // namespace | 323 } // namespace |
324 | 324 |
325 } // namespace net | 325 } // namespace net |
OLD | NEW |