| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 #endif | 10 #endif |
| (...skipping 6308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6319 params.ssl_config_service = default_context_.ssl_config_service(); | 6319 params.ssl_config_service = default_context_.ssl_config_service(); |
| 6320 params.http_auth_handler_factory = | 6320 params.http_auth_handler_factory = |
| 6321 default_context_.http_auth_handler_factory(); | 6321 default_context_.http_auth_handler_factory(); |
| 6322 params.network_delegate = &default_network_delegate_; | 6322 params.network_delegate = &default_network_delegate_; |
| 6323 params.http_server_properties = default_context_.http_server_properties(); | 6323 params.http_server_properties = default_context_.http_server_properties(); |
| 6324 scoped_ptr<HttpNetworkLayer> network_layer( | 6324 scoped_ptr<HttpNetworkLayer> network_layer( |
| 6325 new HttpNetworkLayer(new HttpNetworkSession(params))); | 6325 new HttpNetworkLayer(new HttpNetworkSession(params))); |
| 6326 network_layer->OnSuspend(); | 6326 network_layer->OnSuspend(); |
| 6327 | 6327 |
| 6328 HttpCache http_cache(network_layer.release(), default_context_.net_log(), | 6328 HttpCache http_cache(network_layer.release(), default_context_.net_log(), |
| 6329 HttpCache::DefaultBackend::InMemory(0)); | 6329 HttpCache::DefaultBackend::InMemory(0), false); |
| 6330 | 6330 |
| 6331 TestURLRequestContext context(true); | 6331 TestURLRequestContext context(true); |
| 6332 context.set_http_transaction_factory(&http_cache); | 6332 context.set_http_transaction_factory(&http_cache); |
| 6333 context.Init(); | 6333 context.Init(); |
| 6334 | 6334 |
| 6335 TestDelegate d; | 6335 TestDelegate d; |
| 6336 URLRequest req(GURL("http://127.0.0.1/"), | 6336 URLRequest req(GURL("http://127.0.0.1/"), |
| 6337 DEFAULT_PRIORITY, | 6337 DEFAULT_PRIORITY, |
| 6338 &d, | 6338 &d, |
| 6339 &context); | 6339 &context); |
| (...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7964 | 7964 |
| 7965 EXPECT_FALSE(r.is_pending()); | 7965 EXPECT_FALSE(r.is_pending()); |
| 7966 EXPECT_EQ(1, d->response_started_count()); | 7966 EXPECT_EQ(1, d->response_started_count()); |
| 7967 EXPECT_FALSE(d->received_data_before_response()); | 7967 EXPECT_FALSE(d->received_data_before_response()); |
| 7968 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 7968 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
| 7969 } | 7969 } |
| 7970 } | 7970 } |
| 7971 #endif // !defined(DISABLE_FTP_SUPPORT) | 7971 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 7972 | 7972 |
| 7973 } // namespace net | 7973 } // namespace net |
| OLD | NEW |