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

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

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed too much, back up a bit Created 5 years, 3 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
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 <cstring> 7 #include <cstring>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 params.ssl_config_service = ssl_config_service_.get(); 224 params.ssl_config_service = ssl_config_service_.get();
225 params.http_server_properties = http_server_properties_->GetWeakPtr(); 225 params.http_server_properties = http_server_properties_->GetWeakPtr();
226 params.transport_security_state = transport_security_state_.get(); 226 params.transport_security_state = transport_security_state_.get();
227 return new HttpNetworkSession(params); 227 return new HttpNetworkSession(params);
228 } 228 }
229 229
230 scoped_ptr<ProxyService> proxy_service_; 230 scoped_ptr<ProxyService> proxy_service_;
231 scoped_refptr<SSLConfigService> ssl_config_service_; 231 scoped_refptr<SSLConfigService> ssl_config_service_;
232 scoped_ptr<HttpServerPropertiesImpl> http_server_properties_; 232 scoped_ptr<HttpServerPropertiesImpl> http_server_properties_;
233 scoped_ptr<TransportSecurityState> transport_security_state_; 233 scoped_ptr<TransportSecurityState> transport_security_state_;
234 const scoped_refptr<HttpNetworkSession> session_; 234 const scoped_ptr<HttpNetworkSession> session_;
235 CloseResultWaiter result_waiter_; 235 CloseResultWaiter result_waiter_;
236 MockHttpStream* const mock_stream_; // Owned by |drainer_|. 236 MockHttpStream* const mock_stream_; // Owned by |drainer_|.
237 HttpResponseBodyDrainer* const drainer_; // Deletes itself. 237 HttpResponseBodyDrainer* const drainer_; // Deletes itself.
238 }; 238 };
239 239
240 TEST_F(HttpResponseBodyDrainerTest, DrainBodySyncSingleOK) { 240 TEST_F(HttpResponseBodyDrainerTest, DrainBodySyncSingleOK) {
241 mock_stream_->set_num_chunks(1); 241 mock_stream_->set_num_chunks(1);
242 mock_stream_->set_sync(); 242 mock_stream_->set_sync();
243 drainer_->Start(session_.get()); 243 drainer_->Start(session_.get());
244 EXPECT_FALSE(result_waiter_.WaitForResult()); 244 EXPECT_FALSE(result_waiter_.WaitForResult());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 too_many_chunks += 1; // Now it's too large. 302 too_many_chunks += 1; // Now it's too large.
303 303
304 mock_stream_->set_num_chunks(too_many_chunks); 304 mock_stream_->set_num_chunks(too_many_chunks);
305 drainer_->Start(session_.get()); 305 drainer_->Start(session_.get());
306 EXPECT_TRUE(result_waiter_.WaitForResult()); 306 EXPECT_TRUE(result_waiter_.WaitForResult());
307 } 307 }
308 308
309 } // namespace 309 } // namespace
310 310
311 } // namespace net 311 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698