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

Side by Side Diff: net/dns/dns_config_service_unittest.cc

Issue 10543168: [net/dns] Instrument DnsConfigService to measure performance and failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 8 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 | « net/dns/dns_config_service_posix_unittest.cc ('k') | net/dns/dns_config_service_win.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) 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_config_service.h" 5 #include "net/dns/dns_config_service.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/cancelable_callback.h" 9 #include "base/cancelable_callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 182
183 service_->OnConfigRead(config2); 183 service_->OnConfigRead(config2);
184 service_->OnHostsRead(config2.hosts); 184 service_->OnHostsRead(config2.hosts);
185 EXPECT_TRUE(last_config_.Equals(config2)); 185 EXPECT_TRUE(last_config_.Equals(config2));
186 186
187 service_->OnConfigRead(config3); 187 service_->OnConfigRead(config3);
188 service_->OnHostsRead(config3.hosts); 188 service_->OnHostsRead(config3.hosts);
189 EXPECT_TRUE(last_config_.Equals(config3)); 189 EXPECT_TRUE(last_config_.Equals(config3));
190 } 190 }
191 191
192 #if defined(OS_POSIX) || defined(OS_WIN) 192 #if (defined(OS_POSIX) && !defined(OS_ANDROID)) || defined(OS_WIN)
193 // TODO(szym): This is really an integration test and can time out if HOSTS is 193 // TODO(szym): This is really an integration test and can time out if HOSTS is
194 // huge. http://crbug.com/107810 194 // huge. http://crbug.com/107810
195 TEST_F(DnsConfigServiceTest, FLAKY_GetSystemConfig) { 195 TEST_F(DnsConfigServiceTest, FLAKY_GetSystemConfig) {
196 service_.reset(); 196 service_.reset();
197 scoped_ptr<DnsConfigService> service(DnsConfigService::CreateSystemService()); 197 scoped_ptr<DnsConfigService> service(DnsConfigService::CreateSystemService());
198 198
199 service->Read(base::Bind(&DnsConfigServiceTest::OnConfigChanged, 199 service->Read(base::Bind(&DnsConfigServiceTest::OnConfigChanged,
200 base::Unretained(this))); 200 base::Unretained(this)));
201 base::TimeDelta kTimeout = TestTimeouts::action_max_timeout(); 201 base::TimeDelta kTimeout = TestTimeouts::action_max_timeout();
202 WaitForConfig(kTimeout); 202 WaitForConfig(kTimeout);
203 ASSERT_TRUE(last_config_.IsValid()) << "Did not receive DnsConfig in " << 203 ASSERT_TRUE(last_config_.IsValid()) << "Did not receive DnsConfig in " <<
204 kTimeout.InSecondsF() << "s"; 204 kTimeout.InSecondsF() << "s";
205 } 205 }
206 #endif // OS_POSIX || OS_WIN 206 #endif // OS_POSIX || OS_WIN
207 207
208 } // namespace net 208 } // namespace net
209 209
OLDNEW
« no previous file with comments | « net/dns/dns_config_service_posix_unittest.cc ('k') | net/dns/dns_config_service_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698