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

Unified Diff: net/dns/dns_config_service_unittest.cc

Issue 10537106: [net/dns] Suppress multiple DnsConfig withdrawals after timeout. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added requested DCHECK. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_config_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_config_service_unittest.cc
diff --git a/net/dns/dns_config_service_unittest.cc b/net/dns/dns_config_service_unittest.cc
index e68db27e00e4d46e3ff86b8732162bbf77e1935f..462eadbd5301724b0d6e06071eeb678ff103e488 100644
--- a/net/dns/dns_config_service_unittest.cc
+++ b/net/dns/dns_config_service_unittest.cc
@@ -114,6 +114,7 @@ TEST_F(DnsConfigServiceTest, FirstConfig) {
TEST_F(DnsConfigServiceTest, Timeout) {
DnsConfig config = MakeConfig(1);
config.hosts = MakeHosts(1);
+ ASSERT_TRUE(config.IsValid());
service_->OnConfigRead(config);
service_->OnHostsRead(config.hosts);
@@ -131,6 +132,14 @@ TEST_F(DnsConfigServiceTest, Timeout) {
WaitForConfig(TestTimeouts::action_timeout());
EXPECT_FALSE(last_config_.IsValid());
+ service_->InvalidateConfig();
+ // We don't expect an update. This should time out. If we get an update,
+ // we'll detect unchanged config.
+ WaitForConfig(base::TimeDelta::FromMilliseconds(100) +
+ TestTimeouts::tiny_timeout());
+ EXPECT_FALSE(last_config_.IsValid());
+
+ service_->OnConfigRead(config);
service_->OnHostsRead(config.hosts);
EXPECT_TRUE(last_config_.Equals(config));
}
« no previous file with comments | « net/dns/dns_config_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698