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/host_resolver_impl.h" | 5 #include "net/dns/host_resolver_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/synchronization/condition_variable.h" | 17 #include "base/synchronization/condition_variable.h" |
18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
19 #include "base/test/test_timeouts.h" | 19 #include "base/test/test_timeouts.h" |
20 #include "base/time.h" | 20 #include "base/time/time.h" |
21 #include "net/base/address_list.h" | 21 #include "net/base/address_list.h" |
22 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
23 #include "net/base/net_util.h" | 23 #include "net/base/net_util.h" |
24 #include "net/dns/dns_client.h" | 24 #include "net/dns/dns_client.h" |
25 #include "net/dns/dns_test_util.h" | 25 #include "net/dns/dns_test_util.h" |
26 #include "net/dns/host_cache.h" | 26 #include "net/dns/host_cache.h" |
27 #include "net/dns/mock_host_resolver.h" | 27 #include "net/dns/mock_host_resolver.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
29 | 29 |
30 namespace net { | 30 namespace net { |
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1614 ChangeDnsConfig(config); | 1614 ChangeDnsConfig(config); |
1615 req = CreateRequest(info); | 1615 req = CreateRequest(info); |
1616 // Expect synchronous resolution from DnsHosts. | 1616 // Expect synchronous resolution from DnsHosts. |
1617 EXPECT_EQ(OK, req->Resolve()); | 1617 EXPECT_EQ(OK, req->Resolve()); |
1618 | 1618 |
1619 EXPECT_EQ(saw_ipv4, req->HasAddress("127.0.0.1", 80)); | 1619 EXPECT_EQ(saw_ipv4, req->HasAddress("127.0.0.1", 80)); |
1620 EXPECT_EQ(saw_ipv6, req->HasAddress("::1", 80)); | 1620 EXPECT_EQ(saw_ipv6, req->HasAddress("::1", 80)); |
1621 } | 1621 } |
1622 | 1622 |
1623 } // namespace net | 1623 } // namespace net |
OLD | NEW |