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

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

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reorder initialization in constructor 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/client_socket_factory.cc ('k') | net/socket/client_socket_pool_manager_impl.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/socket/client_socket_pool_base.h" 5 #include "net/socket/client_socket_pool_base.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 11 matching lines...) Expand all
22 #include "base/single_thread_task_runner.h" 22 #include "base/single_thread_task_runner.h"
23 #include "base/strings/string_number_conversions.h" 23 #include "base/strings/string_number_conversions.h"
24 #include "base/strings/stringprintf.h" 24 #include "base/strings/stringprintf.h"
25 #include "base/thread_task_runner_handle.h" 25 #include "base/thread_task_runner_handle.h"
26 #include "base/threading/platform_thread.h" 26 #include "base/threading/platform_thread.h"
27 #include "base/values.h" 27 #include "base/values.h"
28 #include "net/base/load_timing_info.h" 28 #include "net/base/load_timing_info.h"
29 #include "net/base/load_timing_info_test_util.h" 29 #include "net/base/load_timing_info_test_util.h"
30 #include "net/base/net_errors.h" 30 #include "net/base/net_errors.h"
31 #include "net/base/request_priority.h" 31 #include "net/base/request_priority.h"
32 #include "net/base/socket_performance_watcher.h"
32 #include "net/base/test_completion_callback.h" 33 #include "net/base/test_completion_callback.h"
33 #include "net/http/http_response_headers.h" 34 #include "net/http/http_response_headers.h"
34 #include "net/log/net_log.h" 35 #include "net/log/net_log.h"
35 #include "net/log/test_net_log.h" 36 #include "net/log/test_net_log.h"
36 #include "net/log/test_net_log_entry.h" 37 #include "net/log/test_net_log_entry.h"
37 #include "net/log/test_net_log_util.h" 38 #include "net/log/test_net_log_util.h"
38 #include "net/socket/client_socket_factory.h" 39 #include "net/socket/client_socket_factory.h"
39 #include "net/socket/client_socket_handle.h" 40 #include "net/socket/client_socket_handle.h"
40 #include "net/socket/socket_test_util.h" 41 #include "net/socket/socket_test_util.h"
41 #include "net/socket/ssl_client_socket.h" 42 #include "net/socket/ssl_client_socket.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 DatagramSocket::BindType bind_type, 208 DatagramSocket::BindType bind_type,
208 const RandIntCallback& rand_int_cb, 209 const RandIntCallback& rand_int_cb,
209 NetLog* net_log, 210 NetLog* net_log,
210 const NetLog::Source& source) override { 211 const NetLog::Source& source) override {
211 NOTREACHED(); 212 NOTREACHED();
212 return scoped_ptr<DatagramClientSocket>(); 213 return scoped_ptr<DatagramClientSocket>();
213 } 214 }
214 215
215 scoped_ptr<StreamSocket> CreateTransportClientSocket( 216 scoped_ptr<StreamSocket> CreateTransportClientSocket(
216 const AddressList& addresses, 217 const AddressList& addresses,
218 scoped_ptr<SocketPerformanceWatcher> /* socket_performance_watcher */,
217 NetLog* /* net_log */, 219 NetLog* /* net_log */,
218 const NetLog::Source& /*source*/) override { 220 const NetLog::Source& /*source*/) override {
219 allocation_count_++; 221 allocation_count_++;
220 return scoped_ptr<StreamSocket>(); 222 return scoped_ptr<StreamSocket>();
221 } 223 }
222 224
223 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( 225 scoped_ptr<SSLClientSocket> CreateSSLClientSocket(
224 scoped_ptr<ClientSocketHandle> transport_socket, 226 scoped_ptr<ClientSocketHandle> transport_socket,
225 const HostPortPair& host_and_port, 227 const HostPortPair& host_and_port,
226 const SSLConfig& ssl_config, 228 const SSLConfig& ssl_config,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 info.headers = new HttpResponseHeaders(std::string()); 304 info.headers = new HttpResponseHeaders(std::string());
303 handle->set_ssl_error_response_info(info); 305 handle->set_ssl_error_response_info(info);
304 } 306 }
305 } 307 }
306 308
307 private: 309 private:
308 // From ConnectJob: 310 // From ConnectJob:
309 311
310 int ConnectInternal() override { 312 int ConnectInternal() override {
311 AddressList ignored; 313 AddressList ignored;
312 client_socket_factory_->CreateTransportClientSocket(ignored, NULL, 314 client_socket_factory_->CreateTransportClientSocket(ignored, NULL, NULL,
313 NetLog::Source()); 315 NetLog::Source());
314 SetSocket( 316 SetSocket(
315 scoped_ptr<StreamSocket>(new MockClientSocket(net_log().net_log()))); 317 scoped_ptr<StreamSocket>(new MockClientSocket(net_log().net_log())));
316 switch (job_type_) { 318 switch (job_type_) {
317 case kMockJob: 319 case kMockJob:
318 return DoConnect(true /* successful */, false /* sync */, 320 return DoConnect(true /* successful */, false /* sync */,
319 false /* recoverable */); 321 false /* recoverable */);
320 case kMockFailingJob: 322 case kMockFailingJob:
321 return DoConnect(false /* error */, false /* sync */, 323 return DoConnect(false /* error */, false /* sync */,
322 false /* recoverable */); 324 false /* recoverable */);
(...skipping 3515 matching lines...) Expand 10 before | Expand all | Expand 10 after
3838 request(1)->handle()->Reset(); 3840 request(1)->handle()->Reset();
3839 ASSERT_EQ(1, pool_->NumConnectJobsInGroup("a")); 3841 ASSERT_EQ(1, pool_->NumConnectJobsInGroup("a"));
3840 3842
3841 EXPECT_EQ(OK, request(2)->WaitForResult()); 3843 EXPECT_EQ(OK, request(2)->WaitForResult());
3842 EXPECT_FALSE(request(1)->have_result()); 3844 EXPECT_FALSE(request(1)->have_result());
3843 } 3845 }
3844 3846
3845 } // namespace 3847 } // namespace
3846 3848
3847 } // namespace net 3849 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_factory.cc ('k') | net/socket/client_socket_pool_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698