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

Side by Side Diff: net/quic/quic_end_to_end_unittest.cc

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/base/elements_upload_data_stream.h" 10 #include "net/base/elements_upload_data_stream.h"
(...skipping 30 matching lines...) Expand all
41 41
42 namespace test { 42 namespace test {
43 43
44 namespace { 44 namespace {
45 45
46 const char kResponseBody[] = "some arbitrary response body"; 46 const char kResponseBody[] = "some arbitrary response body";
47 47
48 // Factory for creating HttpTransactions, used by TestTransactionConsumer. 48 // Factory for creating HttpTransactions, used by TestTransactionConsumer.
49 class TestTransactionFactory : public HttpTransactionFactory { 49 class TestTransactionFactory : public HttpTransactionFactory {
50 public: 50 public:
51 TestTransactionFactory(const HttpNetworkSession::Params& params) 51 explicit TestTransactionFactory(const HttpNetworkSession::Params& params)
52 : session_(new HttpNetworkSession(params)) {} 52 : session_(new HttpNetworkSession(params)) {}
53 53
54 ~TestTransactionFactory() override {} 54 ~TestTransactionFactory() override {}
55 55
56 // HttpTransactionFactory methods 56 // HttpTransactionFactory methods
57 int CreateTransaction(RequestPriority priority, 57 int CreateTransaction(RequestPriority priority,
58 scoped_ptr<HttpTransaction>* trans) override { 58 scoped_ptr<HttpTransaction>* trans) override {
59 trans->reset(new HttpNetworkTransaction(priority, session_.get())); 59 trans->reset(new HttpNetworkTransaction(priority, session_.get()));
60 return OK; 60 return OK;
61 } 61 }
62 62
63 HttpCache* GetCache() override { return nullptr; } 63 HttpCache* GetCache() override { return nullptr; }
64 64
65 HttpNetworkSession* GetSession() override { return session_.get(); }; 65 HttpNetworkSession* GetSession() override { return session_.get(); };
66 66
67 private: 67 private:
68 scoped_refptr<HttpNetworkSession> session_; 68 scoped_ptr<HttpNetworkSession> session_;
69 }; 69 };
70 70
71 } // namespace 71 } // namespace
72 72
73 class QuicEndToEndTest : public PlatformTest { 73 class QuicEndToEndTest : public PlatformTest {
74 protected: 74 protected:
75 QuicEndToEndTest() 75 QuicEndToEndTest()
76 : host_resolver_impl_(CreateResolverImpl()), 76 : host_resolver_impl_(CreateResolverImpl()),
77 host_resolver_(host_resolver_impl_.Pass()), 77 host_resolver_(host_resolver_impl_.Pass()),
78 ssl_config_service_(new SSLConfigServiceDefaults), 78 ssl_config_service_(new SSLConfigServiceDefaults),
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 base::MessageLoop::current()->Run(); 298 base::MessageLoop::current()->Run();
299 299
300 for (size_t i = 0; i < num_requests; ++i) { 300 for (size_t i = 0; i < num_requests; ++i) {
301 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody); 301 CheckResponse(*consumers[i], "HTTP/1.1 200 OK", kResponseBody);
302 } 302 }
303 STLDeleteElements(&consumers); 303 STLDeleteElements(&consumers);
304 } 304 }
305 305
306 } // namespace test 306 } // namespace test
307 } // namespace net 307 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698