Lines Matching full:stale
571 HostCache::EntryStaleness stale; in TEST() local
594 EXPECT_FALSE(cache.LookupStale(key2, now, &stale)); in TEST()
599 result = cache.LookupStale(key2, now, &stale, true /* ignore_secure */); in TEST()
606 EXPECT_TRUE(cache.LookupStale(key2, now, &stale)); in TEST()
618 HostCache::EntryStaleness stale; in TEST() local
637 // Secure key is preferred when equally stale. in TEST()
650 EXPECT_EQ(secure_key, cache.LookupStale(secure_key, now, &stale)->first); in TEST()
654 cache.LookupStale(secure_key, now, &stale, true /* ignore-secure */) in TEST()
666 EXPECT_EQ(secure_key, cache.LookupStale(secure_key, now, &stale)->first); in TEST()
670 cache.LookupStale(secure_key, now, &stale, true /* ignore-secure */) in TEST()
793 // Try to retrieve stale entries from the cache. They should be returned by
795 TEST(HostCacheTest, Stale) { in TEST() argument
802 HostCache::EntryStaleness stale; in TEST() local
813 EXPECT_FALSE(cache.LookupStale(key, now, &stale)); in TEST()
816 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
817 EXPECT_FALSE(stale.is_stale()); in TEST()
818 EXPECT_EQ(0, stale.stale_hits); in TEST()
826 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
827 EXPECT_FALSE(stale.is_stale()); in TEST()
828 EXPECT_EQ(0, stale.stale_hits); in TEST()
834 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
835 EXPECT_TRUE(stale.is_stale()); in TEST()
836 EXPECT_EQ(base::Seconds(5), stale.expired_by); in TEST()
837 EXPECT_EQ(0, stale.network_changes); in TEST()
838 EXPECT_EQ(1, stale.stale_hits); in TEST()
844 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
845 EXPECT_TRUE(stale.is_stale()); in TEST()
846 EXPECT_EQ(base::Seconds(10), stale.expired_by); in TEST()
847 EXPECT_EQ(0, stale.network_changes); in TEST()
848 EXPECT_EQ(2, stale.stale_hits); in TEST()
854 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
855 EXPECT_TRUE(stale.is_stale()); in TEST()
856 EXPECT_EQ(base::Seconds(10), stale.expired_by); in TEST()
857 EXPECT_EQ(1, stale.network_changes); in TEST()
858 EXPECT_EQ(3, stale.stale_hits); in TEST()
865 HostCache::EntryStaleness stale; in TEST() local
891 EXPECT_TRUE(cache.LookupStale(key1, now, &stale)); in TEST()
892 EXPECT_EQ(1, stale.network_changes); in TEST()
901 EXPECT_TRUE(cache.LookupStale(key1, now, &stale)); in TEST()
905 // |key1| should be chosen for eviction, since it is stale. in TEST()
909 EXPECT_FALSE(cache.LookupStale(key1, now, &stale)); in TEST()
921 EXPECT_TRUE(cache.LookupStale(key2, now, &stale)); in TEST()
923 EXPECT_FALSE(cache.LookupStale(key3, now, &stale)); in TEST()
1316 HostCache::EntryStaleness stale; in TEST() local
1318 // The `expire_by_time_key` entry is stale due to both network changes and in TEST()
1321 EXPECT_THAT(restored_cache.LookupStale(expire_by_time_key, now, &stale), in TEST()
1323 EXPECT_EQ(1, stale.network_changes); in TEST()
1327 (base::Seconds(2) - stale.expired_by).magnitude()); in TEST()
1329 // The `expire_by_changes_key` entry is stale only due to network changes. in TEST()
1331 EXPECT_THAT(restored_cache.LookupStale(expire_by_changes_key, now, &stale), in TEST()
1333 EXPECT_EQ(1, stale.network_changes); in TEST()
1335 (base::Seconds(-3) - stale.expired_by).magnitude()); in TEST()
1409 HostCache::EntryStaleness stale; in TEST() local
1418 restored_cache.LookupStale(to_serialize_key2, now, &stale), in TEST()
1505 HostCache::EntryStaleness stale; in TEST() local
1507 // The "foobar.com" entry is stale due to both network changes and expiration in TEST()
1511 restored_cache.LookupStale(key1, now, &stale); in TEST()
1519 EXPECT_EQ(1, stale.network_changes); in TEST()
1523 (base::Seconds(2) - stale.expired_by).magnitude()); in TEST()
1525 // The "foobar2.com" entry is stale only due to network changes. in TEST()
1528 restored_cache.LookupStale(key2, now, &stale); in TEST()
1535 EXPECT_EQ(1, stale.network_changes); in TEST()
1537 (base::Seconds(-3) - stale.expired_by).magnitude()); in TEST()
1627 HostCache::EntryStaleness stale; in TEST() local
1628 EXPECT_THAT(restored_cache.LookupStale(key1, now, &stale), in TEST()
1694 HostCache::EntryStaleness stale; in TEST() local
1696 restored_cache.LookupStale(key, now, &stale); in TEST()
1724 HostCache::EntryStaleness stale; in TEST() local
1726 restored_cache.LookupStale(key, now, &stale); in TEST()
1801 HostCache::EntryStaleness stale; in TEST() local
1803 restored_cache.LookupStale(key, now, &stale); in TEST()
1855 HostCache::EntryStaleness stale; in TEST() local
1857 restored_cache.LookupStale(key, base::TimeTicks::Now(), &stale); in TEST()
1897 HostCache::EntryStaleness stale; in TEST() local
1899 restored_cache.LookupStale(key, base::TimeTicks::Now(), &stale); in TEST()