| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <time.h> | 5 #include <time.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 //------------------------------------------------------------------------------ | 116 //------------------------------------------------------------------------------ |
| 117 // Use a blocking function to contrast results we get via async services. | 117 // Use a blocking function to contrast results we get via async services. |
| 118 //------------------------------------------------------------------------------ | 118 //------------------------------------------------------------------------------ |
| 119 TimeDelta BlockingDnsLookup(net::HostResolver* resolver, | 119 TimeDelta BlockingDnsLookup(net::HostResolver* resolver, |
| 120 const std::string& hostname) { | 120 const std::string& hostname) { |
| 121 Time start = Time::Now(); | 121 Time start = Time::Now(); |
| 122 | 122 |
| 123 net::AddressList addresses; | 123 net::AddressList addresses; |
| 124 net::HostResolver::RequestInfo info(hostname, 80); | 124 net::HostResolver::RequestInfo info(hostname, 80); |
| 125 resolver->Resolve(info, &addresses, NULL, NULL); | 125 resolver->Resolve(NULL, info, &addresses, NULL, NULL); |
| 126 | 126 |
| 127 return Time::Now() - start; | 127 return Time::Now() - start; |
| 128 } | 128 } |
| 129 | 129 |
| 130 //------------------------------------------------------------------------------ | 130 //------------------------------------------------------------------------------ |
| 131 | 131 |
| 132 // First test to be sure the OS is caching lookups, which is the whole premise | 132 // First test to be sure the OS is caching lookups, which is the whole premise |
| 133 // of DNS prefetching. | 133 // of DNS prefetching. |
| 134 TEST_F(DnsMasterTest, OsCachesLookupsTest) { | 134 TEST_F(DnsMasterTest, OsCachesLookupsTest) { |
| 135 host_resolver_->rules()->AllowDirectLookup("*.google.com"); | 135 host_resolver_->rules()->AllowDirectLookup("*.google.com"); |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 EXPECT_EQ(queue.Pop(), "startup"); | 620 EXPECT_EQ(queue.Pop(), "startup"); |
| 621 EXPECT_EQ(queue.Pop(), "omni"); | 621 EXPECT_EQ(queue.Pop(), "omni"); |
| 622 | 622 |
| 623 EXPECT_TRUE(queue.IsEmpty()); | 623 EXPECT_TRUE(queue.IsEmpty()); |
| 624 } | 624 } |
| 625 | 625 |
| 626 | 626 |
| 627 | 627 |
| 628 | 628 |
| 629 } // namespace chrome_browser_net | 629 } // namespace chrome_browser_net |
| OLD | NEW |