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

Side by Side Diff: net/dns/dns_session_unittest.cc

Issue 657013003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « net/disk_cache/simple/simple_index_unittest.cc ('k') | net/dns/dns_transaction_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/dns/dns_session.h" 5 #include "net/dns/dns_session.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 const RandIntCallback& rand_int_cb, 187 const RandIntCallback& rand_int_cb,
188 net::NetLog* net_log, 188 net::NetLog* net_log,
189 const net::NetLog::Source& source) { 189 const net::NetLog::Source& source) {
190 // We're not actually expecting to send or receive any data, so use the 190 // We're not actually expecting to send or receive any data, so use the
191 // simplest SocketDataProvider with no data supplied. 191 // simplest SocketDataProvider with no data supplied.
192 SocketDataProvider* data_provider = new StaticSocketDataProvider(); 192 SocketDataProvider* data_provider = new StaticSocketDataProvider();
193 data_providers_.push_back(data_provider); 193 data_providers_.push_back(data_provider);
194 scoped_ptr<MockUDPClientSocket> socket( 194 scoped_ptr<MockUDPClientSocket> socket(
195 new MockUDPClientSocket(data_provider, net_log)); 195 new MockUDPClientSocket(data_provider, net_log));
196 data_provider->set_socket(socket.get()); 196 data_provider->set_socket(socket.get());
197 return socket.PassAs<DatagramClientSocket>(); 197 return socket.Pass();
198 } 198 }
199 199
200 TestClientSocketFactory::~TestClientSocketFactory() { 200 TestClientSocketFactory::~TestClientSocketFactory() {
201 STLDeleteElements(&data_providers_); 201 STLDeleteElements(&data_providers_);
202 } 202 }
203 203
204 TEST_F(DnsSessionTest, AllocateFree) { 204 TEST_F(DnsSessionTest, AllocateFree) {
205 scoped_ptr<DnsSession::SocketLease> lease1, lease2; 205 scoped_ptr<DnsSession::SocketLease> lease1, lease2;
206 206
207 Initialize(2); 207 Initialize(2);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 TEST_F(DnsSessionTest, HistogramTimeoutLong) { 243 TEST_F(DnsSessionTest, HistogramTimeoutLong) {
244 config_.timeout = base::TimeDelta::FromSeconds(15); 244 config_.timeout = base::TimeDelta::FromSeconds(15);
245 Initialize(2); 245 Initialize(2);
246 base::TimeDelta timeout = session_->NextTimeout(0, 0); 246 base::TimeDelta timeout = session_->NextTimeout(0, 0);
247 EXPECT_EQ(config_.timeout.InMilliseconds(), timeout.InMilliseconds()); 247 EXPECT_EQ(config_.timeout.InMilliseconds(), timeout.InMilliseconds());
248 } 248 }
249 249
250 } // namespace 250 } // namespace
251 251
252 } // namespace net 252 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/simple/simple_index_unittest.cc ('k') | net/dns/dns_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698