| OLD | NEW |
| 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 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // We're not actually expecting to send or receive any data, so use the | 187 // We're not actually expecting to send or receive any data, so use the |
| 188 // simplest SocketDataProvider with no data supplied. | 188 // simplest SocketDataProvider with no data supplied. |
| 189 SocketDataProvider* data_provider = new StaticSocketDataProvider(); | 189 SocketDataProvider* data_provider = new StaticSocketDataProvider(); |
| 190 data_providers_.push_back(data_provider); | 190 data_providers_.push_back(data_provider); |
| 191 std::unique_ptr<MockUDPClientSocket> socket( | 191 std::unique_ptr<MockUDPClientSocket> socket( |
| 192 new MockUDPClientSocket(data_provider, net_log)); | 192 new MockUDPClientSocket(data_provider, net_log)); |
| 193 return std::move(socket); | 193 return std::move(socket); |
| 194 } | 194 } |
| 195 | 195 |
| 196 TestClientSocketFactory::~TestClientSocketFactory() { | 196 TestClientSocketFactory::~TestClientSocketFactory() { |
| 197 STLDeleteElements(&data_providers_); | 197 base::STLDeleteElements(&data_providers_); |
| 198 } | 198 } |
| 199 | 199 |
| 200 TEST_F(DnsSessionTest, AllocateFree) { | 200 TEST_F(DnsSessionTest, AllocateFree) { |
| 201 std::unique_ptr<DnsSession::SocketLease> lease1, lease2; | 201 std::unique_ptr<DnsSession::SocketLease> lease1, lease2; |
| 202 | 202 |
| 203 Initialize(2); | 203 Initialize(2); |
| 204 EXPECT_TRUE(NoMoreEvents()); | 204 EXPECT_TRUE(NoMoreEvents()); |
| 205 | 205 |
| 206 lease1 = Allocate(0); | 206 lease1 = Allocate(0); |
| 207 EXPECT_TRUE(DidAllocate(0)); | 207 EXPECT_TRUE(DidAllocate(0)); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 TEST_F(DnsSessionTest, HistogramTimeoutLong) { | 241 TEST_F(DnsSessionTest, HistogramTimeoutLong) { |
| 242 config_.timeout = base::TimeDelta::FromSeconds(15); | 242 config_.timeout = base::TimeDelta::FromSeconds(15); |
| 243 Initialize(2); | 243 Initialize(2); |
| 244 base::TimeDelta timeout = session_->NextTimeout(0, 0); | 244 base::TimeDelta timeout = session_->NextTimeout(0, 0); |
| 245 EXPECT_EQ(timeout.InMilliseconds(), config_.timeout.InMilliseconds()); | 245 EXPECT_EQ(timeout.InMilliseconds(), config_.timeout.InMilliseconds()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 } // namespace | 248 } // namespace |
| 249 | 249 |
| 250 } // namespace net | 250 } // namespace net |
| OLD | NEW |