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

Side by Side Diff: net/socket/socks_client_socket_pool_unittest.cc

Issue 1892323002: Change scoped_ptr to std::unique_ptr in //net/socket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/socket/socks_client_socket_pool.cc ('k') | net/socket/socks_client_socket_unittest.cc » ('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/socket/socks_client_socket_pool.h" 5 #include "net/socket/socks_client_socket_pool.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "net/base/load_timing_info.h" 10 #include "net/base/load_timing_info.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 reads_[1] = MockRead(mode, kSOCKS5OkResponse, kSOCKS5OkResponseLength); 76 reads_[1] = MockRead(mode, kSOCKS5OkResponse, kSOCKS5OkResponseLength);
77 reads_[2] = MockRead(mode, 0); 77 reads_[2] = MockRead(mode, 0);
78 78
79 data_.reset(new StaticSocketDataProvider(reads_.get(), 3, 79 data_.reset(new StaticSocketDataProvider(reads_.get(), 3,
80 writes_.get(), 3)); 80 writes_.get(), 3));
81 } 81 }
82 82
83 SocketDataProvider* data_provider() { return data_.get(); } 83 SocketDataProvider* data_provider() { return data_.get(); }
84 84
85 private: 85 private:
86 scoped_ptr<StaticSocketDataProvider> data_; 86 std::unique_ptr<StaticSocketDataProvider> data_;
87 scoped_ptr<MockWrite[]> writes_; 87 std::unique_ptr<MockWrite[]> writes_;
88 scoped_ptr<MockRead[]> reads_; 88 std::unique_ptr<MockRead[]> reads_;
89 }; 89 };
90 90
91 SOCKSClientSocketPoolTest() 91 SOCKSClientSocketPoolTest()
92 : transport_socket_pool_(kMaxSockets, 92 : transport_socket_pool_(kMaxSockets,
93 kMaxSocketsPerGroup, 93 kMaxSocketsPerGroup,
94 &transport_client_socket_factory_), 94 &transport_client_socket_factory_),
95 pool_(kMaxSockets, 95 pool_(kMaxSockets,
96 kMaxSocketsPerGroup, 96 kMaxSocketsPerGroup,
97 &host_resolver_, 97 &host_resolver_,
98 &transport_socket_pool_, 98 &transport_socket_pool_,
99 NULL, 99 NULL,
100 NULL) {} 100 NULL) {}
101 101
102 ~SOCKSClientSocketPoolTest() override {} 102 ~SOCKSClientSocketPoolTest() override {}
103 103
104 int StartRequestV5(const std::string& group_name, RequestPriority priority) { 104 int StartRequestV5(const std::string& group_name, RequestPriority priority) {
105 return test_base_.StartRequestUsingPool( 105 return test_base_.StartRequestUsingPool(
106 &pool_, group_name, priority, ClientSocketPool::RespectLimits::ENABLED, 106 &pool_, group_name, priority, ClientSocketPool::RespectLimits::ENABLED,
107 CreateSOCKSv5Params()); 107 CreateSOCKSv5Params());
108 } 108 }
109 109
110 int GetOrderOfRequest(size_t index) const { 110 int GetOrderOfRequest(size_t index) const {
111 return test_base_.GetOrderOfRequest(index); 111 return test_base_.GetOrderOfRequest(index);
112 } 112 }
113 113
114 std::vector<scoped_ptr<TestSocketRequest>>* requests() { 114 std::vector<std::unique_ptr<TestSocketRequest>>* requests() {
115 return test_base_.requests(); 115 return test_base_.requests();
116 } 116 }
117 117
118 MockClientSocketFactory transport_client_socket_factory_; 118 MockClientSocketFactory transport_client_socket_factory_;
119 MockTransportClientSocketPool transport_socket_pool_; 119 MockTransportClientSocketPool transport_socket_pool_;
120 120
121 MockHostResolver host_resolver_; 121 MockHostResolver host_resolver_;
122 SOCKSClientSocketPool pool_; 122 SOCKSClientSocketPool pool_;
123 ClientSocketPoolTest test_base_; 123 ClientSocketPoolTest test_base_;
124 }; 124 };
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 (*requests())[0]->handle()->Reset(); 344 (*requests())[0]->handle()->Reset();
345 (*requests())[1]->handle()->Reset(); 345 (*requests())[1]->handle()->Reset();
346 } 346 }
347 347
348 // It would be nice to also test the timeouts in SOCKSClientSocketPool. 348 // It would be nice to also test the timeouts in SOCKSClientSocketPool.
349 349
350 } // namespace 350 } // namespace
351 351
352 } // namespace net 352 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socks_client_socket_pool.cc ('k') | net/socket/socks_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698