Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: net/http/http_response_body_drainer_unittest.cc

Issue 2041863002: Remove HttpServerProperies::GetWeakPtr(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_server_properties.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cstring> 9 #include <cstring>
10 10
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 session_(CreateNetworkSession()), 234 session_(CreateNetworkSession()),
235 mock_stream_(new MockHttpStream(&result_waiter_)), 235 mock_stream_(new MockHttpStream(&result_waiter_)),
236 drainer_(new HttpResponseBodyDrainer(mock_stream_)) {} 236 drainer_(new HttpResponseBodyDrainer(mock_stream_)) {}
237 237
238 ~HttpResponseBodyDrainerTest() override {} 238 ~HttpResponseBodyDrainerTest() override {}
239 239
240 HttpNetworkSession* CreateNetworkSession() const { 240 HttpNetworkSession* CreateNetworkSession() const {
241 HttpNetworkSession::Params params; 241 HttpNetworkSession::Params params;
242 params.proxy_service = proxy_service_.get(); 242 params.proxy_service = proxy_service_.get();
243 params.ssl_config_service = ssl_config_service_.get(); 243 params.ssl_config_service = ssl_config_service_.get();
244 params.http_server_properties = http_server_properties_->GetWeakPtr(); 244 params.http_server_properties = http_server_properties_.get();
245 params.transport_security_state = transport_security_state_.get(); 245 params.transport_security_state = transport_security_state_.get();
246 return new HttpNetworkSession(params); 246 return new HttpNetworkSession(params);
247 } 247 }
248 248
249 std::unique_ptr<ProxyService> proxy_service_; 249 std::unique_ptr<ProxyService> proxy_service_;
250 scoped_refptr<SSLConfigService> ssl_config_service_; 250 scoped_refptr<SSLConfigService> ssl_config_service_;
251 std::unique_ptr<HttpServerPropertiesImpl> http_server_properties_; 251 std::unique_ptr<HttpServerPropertiesImpl> http_server_properties_;
252 std::unique_ptr<TransportSecurityState> transport_security_state_; 252 std::unique_ptr<TransportSecurityState> transport_security_state_;
253 const std::unique_ptr<HttpNetworkSession> session_; 253 const std::unique_ptr<HttpNetworkSession> session_;
254 CloseResultWaiter result_waiter_; 254 CloseResultWaiter result_waiter_;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 TEST_F(HttpResponseBodyDrainerTest, DrainBodyCantReuse) { 328 TEST_F(HttpResponseBodyDrainerTest, DrainBodyCantReuse) {
329 mock_stream_->set_num_chunks(1); 329 mock_stream_->set_num_chunks(1);
330 mock_stream_->set_can_reuse_connection(false); 330 mock_stream_->set_can_reuse_connection(false);
331 drainer_->Start(session_.get()); 331 drainer_->Start(session_.get());
332 EXPECT_TRUE(result_waiter_.WaitForResult()); 332 EXPECT_TRUE(result_waiter_.WaitForResult());
333 } 333 }
334 334
335 } // namespace 335 } // namespace
336 336
337 } // namespace net 337 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_server_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698