| 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/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 Loading... |
| 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 |
| OLD | NEW |