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 "chrome/browser/net/connection_tester.h" | 5 #include "chrome/browser/net/connection_tester.h" |
6 | 6 |
7 #include "base/prefs/testing_pref_service.h" | 7 #include "base/prefs/testing_pref_service.h" |
8 #include "content/public/test/test_browser_thread.h" | 8 #include "content/public/test/test_browser_thread.h" |
9 #include "net/cert/mock_cert_verifier.h" | 9 #include "net/cert/mock_cert_verifier.h" |
10 #include "net/cookies/cookie_monster.h" | 10 #include "net/cookies/cookie_monster.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 proxy_script_fetcher_context_->set_cert_verifier(cert_verifier_.get()); | 123 proxy_script_fetcher_context_->set_cert_verifier(cert_verifier_.get()); |
124 proxy_script_fetcher_context_->set_http_auth_handler_factory( | 124 proxy_script_fetcher_context_->set_http_auth_handler_factory( |
125 &http_auth_handler_factory_); | 125 &http_auth_handler_factory_); |
126 proxy_service_.reset(net::ProxyService::CreateDirect()); | 126 proxy_service_.reset(net::ProxyService::CreateDirect()); |
127 proxy_script_fetcher_context_->set_proxy_service(proxy_service_.get()); | 127 proxy_script_fetcher_context_->set_proxy_service(proxy_service_.get()); |
128 ssl_config_service_ = new net::SSLConfigServiceDefaults; | 128 ssl_config_service_ = new net::SSLConfigServiceDefaults; |
129 net::HttpNetworkSession::Params session_params; | 129 net::HttpNetworkSession::Params session_params; |
130 session_params.host_resolver = &host_resolver_; | 130 session_params.host_resolver = &host_resolver_; |
131 session_params.cert_verifier = cert_verifier_.get(); | 131 session_params.cert_verifier = cert_verifier_.get(); |
132 session_params.http_auth_handler_factory = &http_auth_handler_factory_; | 132 session_params.http_auth_handler_factory = &http_auth_handler_factory_; |
133 session_params.ssl_config_service = ssl_config_service_; | 133 session_params.ssl_config_service = ssl_config_service_.get(); |
134 session_params.proxy_service = proxy_service_.get(); | 134 session_params.proxy_service = proxy_service_.get(); |
135 session_params.http_server_properties = &http_server_properties_impl_; | 135 session_params.http_server_properties = &http_server_properties_impl_; |
136 scoped_refptr<net::HttpNetworkSession> network_session( | 136 scoped_refptr<net::HttpNetworkSession> network_session( |
137 new net::HttpNetworkSession(session_params)); | 137 new net::HttpNetworkSession(session_params)); |
138 http_transaction_factory_.reset( | 138 http_transaction_factory_.reset( |
139 new net::HttpNetworkLayer(network_session)); | 139 new net::HttpNetworkLayer(network_session.get())); |
140 proxy_script_fetcher_context_->set_http_transaction_factory( | 140 proxy_script_fetcher_context_->set_http_transaction_factory( |
141 http_transaction_factory_.get()); | 141 http_transaction_factory_.get()); |
142 // In-memory cookie store. | 142 // In-memory cookie store. |
143 proxy_script_fetcher_context_->set_cookie_store( | 143 proxy_script_fetcher_context_->set_cookie_store( |
144 new net::CookieMonster(NULL, NULL)); | 144 new net::CookieMonster(NULL, NULL)); |
145 } | 145 } |
146 }; | 146 }; |
147 | 147 |
148 TEST_F(ConnectionTesterTest, RunAllTests) { | 148 TEST_F(ConnectionTesterTest, RunAllTests) { |
149 ASSERT_TRUE(test_server_.Start()); | 149 ASSERT_TRUE(test_server_.Start()); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // net::ClientSocketPoolBaseHelper, since the "Group" holds a pointer | 202 // net::ClientSocketPoolBaseHelper, since the "Group" holds a pointer |
203 // |backup_task| that it will try to deref during the destructor, but | 203 // |backup_task| that it will try to deref during the destructor, but |
204 // depending on the order that pending tasks were deleted in, it might | 204 // depending on the order that pending tasks were deleted in, it might |
205 // already be invalid! See http://crbug.com/43291. | 205 // already be invalid! See http://crbug.com/43291. |
206 base::MessageLoop::current()->PostTask(FROM_HERE, | 206 base::MessageLoop::current()->PostTask(FROM_HERE, |
207 base::MessageLoop::QuitClosure()); | 207 base::MessageLoop::QuitClosure()); |
208 base::MessageLoop::current()->Run(); | 208 base::MessageLoop::current()->Run(); |
209 } | 209 } |
210 | 210 |
211 } // namespace | 211 } // namespace |
OLD | NEW |