| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/url_request/url_request_unittest.h" | 5 #include "net/url_request/url_request_unittest.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 http_transaction_factory_ = | 58 http_transaction_factory_ = |
| 59 new net::HttpCache( | 59 new net::HttpCache( |
| 60 net::HttpNetworkLayer::CreateFactory(host_resolver_, proxy_service_, | 60 net::HttpNetworkLayer::CreateFactory(host_resolver_, proxy_service_, |
| 61 ssl_config_service_), | 61 ssl_config_service_), |
| 62 disk_cache::CreateInMemoryCacheBackend(0)); | 62 disk_cache::CreateInMemoryCacheBackend(0)); |
| 63 // In-memory cookie store. | 63 // In-memory cookie store. |
| 64 cookie_store_ = new net::CookieMonster(); | 64 cookie_store_ = new net::CookieMonster(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual ~URLRequestTestContext() { | 67 virtual ~URLRequestTestContext() { |
| 68 delete cookie_store_; | |
| 69 delete ftp_transaction_factory_; | 68 delete ftp_transaction_factory_; |
| 70 delete http_transaction_factory_; | 69 delete http_transaction_factory_; |
| 71 } | 70 } |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 class TestURLRequest : public URLRequest { | 73 class TestURLRequest : public URLRequest { |
| 75 public: | 74 public: |
| 76 TestURLRequest(const GURL& url, Delegate* delegate) | 75 TestURLRequest(const GURL& url, Delegate* delegate) |
| 77 : URLRequest(url, delegate) { | 76 : URLRequest(url, delegate) { |
| 78 set_context(new URLRequestTestContext()); | 77 set_context(new URLRequestTestContext()); |
| (...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2110 | 2109 |
| 2111 int64 file_size = 0; | 2110 int64 file_size = 0; |
| 2112 file_util::GetFileSize(app_path, &file_size); | 2111 file_util::GetFileSize(app_path, &file_size); |
| 2113 | 2112 |
| 2114 EXPECT_FALSE(r.is_pending()); | 2113 EXPECT_FALSE(r.is_pending()); |
| 2115 EXPECT_EQ(1, d.response_started_count()); | 2114 EXPECT_EQ(1, d.response_started_count()); |
| 2116 EXPECT_FALSE(d.received_data_before_response()); | 2115 EXPECT_FALSE(d.received_data_before_response()); |
| 2117 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); | 2116 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); |
| 2118 } | 2117 } |
| 2119 } | 2118 } |
| OLD | NEW |