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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "net/dns/dns_protocol.h" | 14 #include "net/dns/dns_protocol.h" |
15 #include "net/dns/dns_socket_pool.h" | 15 #include "net/dns/dns_socket_pool.h" |
16 #include "net/log/net_log.h" | 16 #include "net/log/net_log.h" |
17 #include "net/socket/socket_test_util.h" | 17 #include "net/socket/socket_test_util.h" |
18 #include "net/socket/ssl_client_socket.h" | 18 #include "net/socket/ssl_client_socket.h" |
19 #include "net/socket/stream_socket.h" | 19 #include "net/socket/stream_socket.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 | 23 |
| 24 class SocketPerformanceWatcherFactory; |
| 25 |
24 namespace { | 26 namespace { |
25 | 27 |
26 class TestClientSocketFactory : public ClientSocketFactory { | 28 class TestClientSocketFactory : public ClientSocketFactory { |
27 public: | 29 public: |
28 ~TestClientSocketFactory() override; | 30 ~TestClientSocketFactory() override; |
29 | 31 |
30 scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket( | 32 scoped_ptr<DatagramClientSocket> CreateDatagramClientSocket( |
31 DatagramSocket::BindType bind_type, | 33 DatagramSocket::BindType bind_type, |
32 const RandIntCallback& rand_int_cb, | 34 const RandIntCallback& rand_int_cb, |
33 NetLog* net_log, | 35 NetLog* net_log, |
34 const NetLog::Source& source) override; | 36 const NetLog::Source& source) override; |
35 | 37 |
36 scoped_ptr<StreamSocket> CreateTransportClientSocket( | 38 scoped_ptr<StreamSocket> CreateTransportClientSocket( |
37 const AddressList& addresses, | 39 const AddressList& addresses, |
| 40 SocketPerformanceWatcherFactory*, |
38 NetLog*, | 41 NetLog*, |
39 const NetLog::Source&) override { | 42 const NetLog::Source&) override { |
40 NOTIMPLEMENTED(); | 43 NOTIMPLEMENTED(); |
41 return scoped_ptr<StreamSocket>(); | 44 return scoped_ptr<StreamSocket>(); |
42 } | 45 } |
43 | 46 |
44 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( | 47 scoped_ptr<SSLClientSocket> CreateSSLClientSocket( |
45 scoped_ptr<ClientSocketHandle> transport_socket, | 48 scoped_ptr<ClientSocketHandle> transport_socket, |
46 const HostPortPair& host_and_port, | 49 const HostPortPair& host_and_port, |
47 const SSLConfig& ssl_config, | 50 const SSLConfig& ssl_config, |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 TEST_F(DnsSessionTest, HistogramTimeoutLong) { | 243 TEST_F(DnsSessionTest, HistogramTimeoutLong) { |
241 config_.timeout = base::TimeDelta::FromSeconds(15); | 244 config_.timeout = base::TimeDelta::FromSeconds(15); |
242 Initialize(2); | 245 Initialize(2); |
243 base::TimeDelta timeout = session_->NextTimeout(0, 0); | 246 base::TimeDelta timeout = session_->NextTimeout(0, 0); |
244 EXPECT_EQ(config_.timeout.InMilliseconds(), timeout.InMilliseconds()); | 247 EXPECT_EQ(config_.timeout.InMilliseconds(), timeout.InMilliseconds()); |
245 } | 248 } |
246 | 249 |
247 } // namespace | 250 } // namespace |
248 | 251 |
249 } // namespace net | 252 } // namespace net |
OLD | NEW |