| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |