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 1047103002: Avoid initial NetworkChangeNotifier OnDNSChanged() signal on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert an accidental test enabling Created 5 years, 8 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
« no previous file with comments | « net/dns/dns_config_service_posix_unittest.cc ('k') | net/dns/host_resolver_impl.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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 last_config_ = bad_config; 328 last_config_ = bad_config;
329 // No change, so no update. 329 // No change, so no update.
330 service_->InvalidateConfig(); 330 service_->InvalidateConfig();
331 service_->OnConfigRead(config2); 331 service_->OnConfigRead(config2);
332 EXPECT_TRUE(last_config_.Equals(bad_config)); 332 EXPECT_TRUE(last_config_.Equals(bad_config));
333 } 333 }
334 334
335 #if (defined(OS_POSIX) && !defined(OS_ANDROID)) || defined(OS_WIN) 335 #if (defined(OS_POSIX) && !defined(OS_ANDROID)) || defined(OS_WIN)
336 // TODO(szym): This is really an integration test and can time out if HOSTS is 336 // TODO(szym): This is really an integration test and can time out if HOSTS is
337 // huge. http://crbug.com/107810 337 // huge. http://crbug.com/107810
338 // On Android the hosts file is not user modifyable, so it's always tiny,
339 // however devices used for testing are likely to have no network connectivity
340 // and hence no DNS configuration so this test will just fail to find a valid
341 // config.
338 TEST_F(DnsConfigServiceTest, DISABLED_GetSystemConfig) { 342 TEST_F(DnsConfigServiceTest, DISABLED_GetSystemConfig) {
339 service_.reset(); 343 service_.reset();
340 scoped_ptr<DnsConfigService> service(DnsConfigService::CreateSystemService()); 344 scoped_ptr<DnsConfigService> service(DnsConfigService::CreateSystemService());
341 345
342 service->ReadConfig(base::Bind(&DnsConfigServiceTest::OnConfigChanged, 346 service->ReadConfig(base::Bind(&DnsConfigServiceTest::OnConfigChanged,
343 base::Unretained(this))); 347 base::Unretained(this)));
344 base::TimeDelta kTimeout = TestTimeouts::action_max_timeout(); 348 base::TimeDelta kTimeout = TestTimeouts::action_max_timeout();
345 WaitForConfig(kTimeout); 349 WaitForConfig(kTimeout);
346 ASSERT_TRUE(last_config_.IsValid()) << "Did not receive DnsConfig in " << 350 ASSERT_TRUE(last_config_.IsValid()) << "Did not receive DnsConfig in " <<
347 kTimeout.InSecondsF() << "s"; 351 kTimeout.InSecondsF() << "s";
348 } 352 }
349 #endif // OS_POSIX || OS_WIN 353 #endif // OS_POSIX || OS_WIN
350 354
351 } // namespace net 355 } // namespace net
352 356
OLDNEW
« no previous file with comments | « net/dns/dns_config_service_posix_unittest.cc ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698