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

Side by Side Diff: chrome/browser/net/dns_master_unittest.cc

Issue 125107: * Move the global "DnsResolutionObserver" code depended on by DNS prefetcher,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address jar's comments Created 11 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/dns_master.cc ('k') | net/base/client_socket_handle.h » ('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) 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 //------------------------------------------------------------------------------ 108 //------------------------------------------------------------------------------
109 // Use a blocking function to contrast results we get via async services. 109 // Use a blocking function to contrast results we get via async services.
110 //------------------------------------------------------------------------------ 110 //------------------------------------------------------------------------------
111 TimeDelta BlockingDnsLookup(const std::string& hostname) { 111 TimeDelta BlockingDnsLookup(const std::string& hostname) {
112 Time start = Time::Now(); 112 Time start = Time::Now();
113 113
114 net::HostResolver resolver; 114 net::HostResolver resolver;
115 net::AddressList addresses; 115 net::AddressList addresses;
116 resolver.Resolve(hostname, 80, &addresses, NULL, NULL); 116 net::HostResolver::RequestInfo info(hostname, 80);
117 resolver.Resolve(info, &addresses, NULL, NULL);
117 118
118 return Time::Now() - start; 119 return Time::Now() - start;
119 } 120 }
120 121
121 //------------------------------------------------------------------------------ 122 //------------------------------------------------------------------------------
122 123
123 // First test to be sure the OS is caching lookups, which is the whole premise 124 // First test to be sure the OS is caching lookups, which is the whole premise
124 // of DNS prefetching. 125 // of DNS prefetching.
125 TEST_F(DnsMasterTest, OsCachesLookupsTest) { 126 TEST_F(DnsMasterTest, OsCachesLookupsTest) {
126 mapper_->AllowDirectLookup("*.google.com"); 127 mapper_->AllowDirectLookup("*.google.com");
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 EXPECT_EQ(queue.Pop(), "startup"); 609 EXPECT_EQ(queue.Pop(), "startup");
609 EXPECT_EQ(queue.Pop(), "omni"); 610 EXPECT_EQ(queue.Pop(), "omni");
610 611
611 EXPECT_TRUE(queue.IsEmpty()); 612 EXPECT_TRUE(queue.IsEmpty());
612 } 613 }
613 614
614 615
615 616
616 617
617 } // namespace chrome_browser_net 618 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/dns_master.cc ('k') | net/base/client_socket_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698