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

Side by Side Diff: net/socket/transport_client_socket_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
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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 AddressList addr; 110 AddressList addr;
111 // MockHostResolver resolves everything to 127.0.0.1. 111 // MockHostResolver resolves everything to 127.0.0.1.
112 scoped_ptr<HostResolver> resolver(new MockHostResolver()); 112 scoped_ptr<HostResolver> resolver(new MockHostResolver());
113 HostResolver::RequestInfo info(HostPortPair("localhost", listen_port_)); 113 HostResolver::RequestInfo info(HostPortPair("localhost", listen_port_));
114 TestCompletionCallback callback; 114 TestCompletionCallback callback;
115 int rv = resolver->Resolve(info, DEFAULT_PRIORITY, &addr, callback.callback(), 115 int rv = resolver->Resolve(info, DEFAULT_PRIORITY, &addr, callback.callback(),
116 NULL, BoundNetLog()); 116 NULL, BoundNetLog());
117 CHECK_EQ(ERR_IO_PENDING, rv); 117 CHECK_EQ(ERR_IO_PENDING, rv);
118 rv = callback.WaitForResult(); 118 rv = callback.WaitForResult();
119 CHECK_EQ(rv, OK); 119 CHECK_EQ(rv, OK);
120 sock_ = socket_factory_->CreateTransportClientSocket(addr, &net_log_, 120 sock_ = socket_factory_->CreateTransportClientSocket(addr, NULL, &net_log_,
121 NetLog::Source()); 121 NetLog::Source());
122 } 122 }
123 123
124 int TransportClientSocketTest::DrainClientSocket( 124 int TransportClientSocketTest::DrainClientSocket(
125 IOBuffer* buf, 125 IOBuffer* buf,
126 uint32_t buf_len, 126 uint32_t buf_len,
127 uint32_t bytes_to_read, 127 uint32_t bytes_to_read,
128 TestCompletionCallback* callback) { 128 TestCompletionCallback* callback) {
129 int rv = OK; 129 int rv = OK;
130 uint32_t bytes_read = 0; 130 uint32_t bytes_read = 0;
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 462
463 // It's possible the read is blocked because it's already read all the data. 463 // It's possible the read is blocked because it's already read all the data.
464 // Close the server socket, so there will at least be a 0-byte read. 464 // Close the server socket, so there will at least be a 0-byte read.
465 CloseServerSocket(); 465 CloseServerSocket();
466 466
467 rv = callback.WaitForResult(); 467 rv = callback.WaitForResult();
468 EXPECT_GE(rv, 0); 468 EXPECT_GE(rv, 0);
469 } 469 }
470 470
471 } // namespace net 471 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/transport_client_socket_pool_unittest.cc ('k') | net/socket/websocket_transport_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698