Index: net/dns/host_cache_unittest.cc |
diff --git a/net/dns/host_cache_unittest.cc b/net/dns/host_cache_unittest.cc |
index 34309c1223cc3d2815e5fcdadd035de222dbc3db..ea8b1b220f51962d70a1727ccb098c352b1cfe35 100644 |
--- a/net/dns/host_cache_unittest.cc |
+++ b/net/dns/host_cache_unittest.cc |
@@ -219,10 +219,10 @@ TEST(HostCacheTest, HostResolverFlagsArePartOfKey) { |
base::TimeTicks now; |
HostCache::Key key1("foobar.com", ADDRESS_FAMILY_IPV4, 0); |
- HostCache::Key key2("foobar.com", ADDRESS_FAMILY_IPV4, |
- HOST_RESOLVER_CANONNAME); |
- HostCache::Key key3("foobar.com", ADDRESS_FAMILY_IPV4, |
- HOST_RESOLVER_LOOPBACK_ONLY); |
+ HostCache::Key key2( |
+ "foobar.com", ADDRESS_FAMILY_IPV4, HOST_RESOLVER_CANONNAME); |
+ HostCache::Key key3( |
+ "foobar.com", ADDRESS_FAMILY_IPV4, HOST_RESOLVER_LOOPBACK_ONLY); |
HostCache::Entry entry = HostCache::Entry(OK, AddressList()); |
EXPECT_EQ(0U, cache.size()); |
@@ -265,7 +265,7 @@ TEST(HostCacheTest, NoCache) { |
HostCache::Entry entry = HostCache::Entry(OK, AddressList()); |
// Lookup and Set should have no effect. |
- EXPECT_FALSE(cache.Lookup(Key("foobar.com"),now)); |
+ EXPECT_FALSE(cache.Lookup(Key("foobar.com"), now)); |
cache.Set(Key("foobar.com"), entry, now, kTTL); |
EXPECT_FALSE(cache.Lookup(Key("foobar.com"), now)); |
@@ -309,56 +309,31 @@ TEST(HostCacheTest, KeyComparators) { |
// 1 means key1 is greater than key2 |
int expected_comparison; |
} tests[] = { |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- 0 |
- }, |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0), |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- 1 |
- }, |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0), |
- -1 |
- }, |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- -1 |
- }, |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0), |
- HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- 1 |
- }, |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- HostCache::Key("host2", ADDRESS_FAMILY_IPV4, 0), |
- -1 |
- }, |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, |
- HOST_RESOLVER_CANONNAME), |
- -1 |
- }, |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, |
- HOST_RESOLVER_CANONNAME), |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
- 1 |
- }, |
- { |
- HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, |
- HOST_RESOLVER_CANONNAME), |
- HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, |
- HOST_RESOLVER_CANONNAME), |
- -1 |
- }, |
- }; |
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
+ HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), 0}, |
+ {HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0), |
+ HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), 1}, |
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
+ HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0), -1}, |
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
+ HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 0), -1}, |
+ {HostCache::Key("host1", ADDRESS_FAMILY_IPV4, 0), |
+ HostCache::Key("host2", ADDRESS_FAMILY_UNSPECIFIED, 0), 1}, |
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
+ HostCache::Key("host2", ADDRESS_FAMILY_IPV4, 0), -1}, |
+ {HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), |
+ HostCache::Key( |
+ "host1", ADDRESS_FAMILY_UNSPECIFIED, HOST_RESOLVER_CANONNAME), |
+ -1}, |
+ {HostCache::Key( |
+ "host1", ADDRESS_FAMILY_UNSPECIFIED, HOST_RESOLVER_CANONNAME), |
+ HostCache::Key("host1", ADDRESS_FAMILY_UNSPECIFIED, 0), 1}, |
+ {HostCache::Key( |
+ "host1", ADDRESS_FAMILY_UNSPECIFIED, HOST_RESOLVER_CANONNAME), |
+ HostCache::Key( |
+ "host2", ADDRESS_FAMILY_UNSPECIFIED, HOST_RESOLVER_CANONNAME), |
+ -1}, |
+ }; |
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { |
SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "]", i)); |