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 "chrome/browser/net/connection_tester.h" | 5 #include "chrome/browser/net/connection_tester.h" |
6 | 6 |
7 #include "chrome/browser/browser_thread.h" | 7 #include "chrome/browser/browser_thread.h" |
8 #include "chrome/test/testing_pref_service.h" | 8 #include "chrome/test/testing_pref_service.h" |
9 #include "net/base/cert_verifier.h" | 9 #include "net/base/cert_verifier.h" |
10 #include "net/base/cookie_monster.h" | 10 #include "net/base/cookie_monster.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 private: | 110 private: |
111 void InitializeRequestContext() { | 111 void InitializeRequestContext() { |
112 proxy_script_fetcher_context_->set_host_resolver(&host_resolver_); | 112 proxy_script_fetcher_context_->set_host_resolver(&host_resolver_); |
113 proxy_script_fetcher_context_->set_cert_verifier(&cert_verifier_); | 113 proxy_script_fetcher_context_->set_cert_verifier(&cert_verifier_); |
114 proxy_script_fetcher_context_->set_dnsrr_resolver(&dnsrr_resolver_); | 114 proxy_script_fetcher_context_->set_dnsrr_resolver(&dnsrr_resolver_); |
115 proxy_script_fetcher_context_->set_http_auth_handler_factory( | 115 proxy_script_fetcher_context_->set_http_auth_handler_factory( |
116 &http_auth_handler_factory_); | 116 &http_auth_handler_factory_); |
117 proxy_service_ = net::ProxyService::CreateDirect(); | 117 proxy_service_ = net::ProxyService::CreateDirect(); |
118 proxy_script_fetcher_context_->set_proxy_service(proxy_service_); | 118 proxy_script_fetcher_context_->set_proxy_service(proxy_service_); |
119 ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); | 119 ssl_config_service_ = net::SSLConfigService::CreateSystemSSLConfigService(); |
120 proxy_script_fetcher_context_->set_http_transaction_factory( | 120 http_transaction_factory_.reset( |
121 new net::HttpNetworkLayer( | 121 new net::HttpNetworkLayer( |
122 client_socket_factory_, | 122 client_socket_factory_, |
123 &host_resolver_, | 123 &host_resolver_, |
124 &cert_verifier_, | 124 &cert_verifier_, |
125 &dnsrr_resolver_, | 125 &dnsrr_resolver_, |
126 NULL /* DNS cert provenance checker */, | 126 NULL /* DNS cert provenance checker */, |
127 NULL /* ssl_host_info_factory */, | 127 NULL /* ssl_host_info_factory */, |
128 proxy_service_.get(), | 128 proxy_service_.get(), |
129 ssl_config_service_, | 129 ssl_config_service_, |
130 new net::SpdySessionPool(ssl_config_service_), | 130 new net::SpdySessionPool(ssl_config_service_), |
131 &http_auth_handler_factory_, | 131 &http_auth_handler_factory_, |
132 NULL /* NetworkDelegate */, | 132 NULL /* NetworkDelegate */, |
133 NULL /* NetLog */)); | 133 NULL /* NetLog */)); |
| 134 proxy_script_fetcher_context_->set_http_transaction_factory( |
| 135 http_transaction_factory_.get()); |
134 // In-memory cookie store. | 136 // In-memory cookie store. |
135 proxy_script_fetcher_context_->set_cookie_store( | 137 proxy_script_fetcher_context_->set_cookie_store( |
136 new net::CookieMonster(NULL, NULL)); | 138 new net::CookieMonster(NULL, NULL)); |
137 } | 139 } |
138 | 140 |
139 MessageLoop message_loop_; | 141 MessageLoop message_loop_; |
140 BrowserThread io_thread_; | 142 BrowserThread io_thread_; |
141 }; | 143 }; |
142 | 144 |
143 TEST_F(ConnectionTesterTest, RunAllTests) { | 145 TEST_F(ConnectionTesterTest, RunAllTests) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // any pending tasks instead of running them. This causes a problem with | 192 // any pending tasks instead of running them. This causes a problem with |
191 // net::ClientSocketPoolBaseHelper, since the "Group" holds a pointer | 193 // net::ClientSocketPoolBaseHelper, since the "Group" holds a pointer |
192 // |backup_task| that it will try to deref during the destructor, but | 194 // |backup_task| that it will try to deref during the destructor, but |
193 // depending on the order that pending tasks were deleted in, it might | 195 // depending on the order that pending tasks were deleted in, it might |
194 // already be invalid! See http://crbug.com/43291. | 196 // already be invalid! See http://crbug.com/43291. |
195 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 197 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
196 MessageLoop::current()->Run(); | 198 MessageLoop::current()->Run(); |
197 } | 199 } |
198 | 200 |
199 } // namespace | 201 } // namespace |
OLD | NEW |