Lines Matching full:stale
572 HostCache::EntryStaleness stale; in TEST() local
595 EXPECT_FALSE(cache.LookupStale(key2, now, &stale)); in TEST()
600 result = cache.LookupStale(key2, now, &stale, true /* ignore_secure */); in TEST()
607 EXPECT_TRUE(cache.LookupStale(key2, now, &stale)); in TEST()
619 HostCache::EntryStaleness stale; in TEST() local
638 // Secure key is preferred when equally stale. in TEST()
651 EXPECT_EQ(secure_key, cache.LookupStale(secure_key, now, &stale)->first); in TEST()
655 cache.LookupStale(secure_key, now, &stale, true /* ignore-secure */) in TEST()
667 EXPECT_EQ(secure_key, cache.LookupStale(secure_key, now, &stale)->first); in TEST()
671 cache.LookupStale(secure_key, now, &stale, true /* ignore-secure */) in TEST()
794 // Try to retrieve stale entries from the cache. They should be returned by
796 TEST(HostCacheTest, Stale) { in TEST() argument
803 HostCache::EntryStaleness stale; in TEST() local
814 EXPECT_FALSE(cache.LookupStale(key, now, &stale)); in TEST()
817 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
818 EXPECT_FALSE(stale.is_stale()); in TEST()
819 EXPECT_EQ(0, stale.stale_hits); in TEST()
827 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
828 EXPECT_FALSE(stale.is_stale()); in TEST()
829 EXPECT_EQ(0, stale.stale_hits); in TEST()
835 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
836 EXPECT_TRUE(stale.is_stale()); in TEST()
837 EXPECT_EQ(base::Seconds(5), stale.expired_by); in TEST()
838 EXPECT_EQ(0, stale.network_changes); in TEST()
839 EXPECT_EQ(1, stale.stale_hits); in TEST()
845 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
846 EXPECT_TRUE(stale.is_stale()); in TEST()
847 EXPECT_EQ(base::Seconds(10), stale.expired_by); in TEST()
848 EXPECT_EQ(0, stale.network_changes); in TEST()
849 EXPECT_EQ(2, stale.stale_hits); in TEST()
855 EXPECT_TRUE(cache.LookupStale(key, now, &stale)); in TEST()
856 EXPECT_TRUE(stale.is_stale()); in TEST()
857 EXPECT_EQ(base::Seconds(10), stale.expired_by); in TEST()
858 EXPECT_EQ(1, stale.network_changes); in TEST()
859 EXPECT_EQ(3, stale.stale_hits); in TEST()
866 HostCache::EntryStaleness stale; in TEST() local
892 EXPECT_TRUE(cache.LookupStale(key1, now, &stale)); in TEST()
893 EXPECT_EQ(1, stale.network_changes); in TEST()
902 EXPECT_TRUE(cache.LookupStale(key1, now, &stale)); in TEST()
906 // |key1| should be chosen for eviction, since it is stale. in TEST()
910 EXPECT_FALSE(cache.LookupStale(key1, now, &stale)); in TEST()
922 EXPECT_TRUE(cache.LookupStale(key2, now, &stale)); in TEST()
924 EXPECT_FALSE(cache.LookupStale(key3, now, &stale)); in TEST()
1311 HostCache::EntryStaleness stale; in TEST() local
1313 // The `expire_by_time_key` entry is stale due to both network changes and in TEST()
1316 EXPECT_THAT(restored_cache.LookupStale(expire_by_time_key, now, &stale), in TEST()
1318 EXPECT_EQ(1, stale.network_changes); in TEST()
1322 (base::Seconds(2) - stale.expired_by).magnitude()); in TEST()
1324 // The `expire_by_changes_key` entry is stale only due to network changes. in TEST()
1326 EXPECT_THAT(restored_cache.LookupStale(expire_by_changes_key, now, &stale), in TEST()
1328 EXPECT_EQ(1, stale.network_changes); in TEST()
1330 (base::Seconds(-3) - stale.expired_by).magnitude()); in TEST()
1404 HostCache::EntryStaleness stale; in TEST() local
1413 restored_cache.LookupStale(to_serialize_key2, now, &stale), in TEST()
1500 HostCache::EntryStaleness stale; in TEST() local
1502 // The "foobar.com" entry is stale due to both network changes and expiration in TEST()
1506 restored_cache.LookupStale(key1, now, &stale); in TEST()
1513 EXPECT_EQ(1, stale.network_changes); in TEST()
1517 (base::Seconds(2) - stale.expired_by).magnitude()); in TEST()
1519 // The "foobar2.com" entry is stale only due to network changes. in TEST()
1522 restored_cache.LookupStale(key2, now, &stale); in TEST()
1528 EXPECT_EQ(1, stale.network_changes); in TEST()
1530 (base::Seconds(-3) - stale.expired_by).magnitude()); in TEST()
1618 HostCache::EntryStaleness stale; in TEST() local
1619 EXPECT_THAT(restored_cache.LookupStale(key1, now, &stale), in TEST()
1685 HostCache::EntryStaleness stale; in TEST() local
1687 restored_cache.LookupStale(key, now, &stale); in TEST()
1715 HostCache::EntryStaleness stale; in TEST() local
1717 restored_cache.LookupStale(key, now, &stale); in TEST()
1792 HostCache::EntryStaleness stale; in TEST() local
1794 restored_cache.LookupStale(key, now, &stale); in TEST()
1846 HostCache::EntryStaleness stale; in TEST() local
1848 restored_cache.LookupStale(key, base::TimeTicks::Now(), &stale); in TEST()
1888 HostCache::EntryStaleness stale; in TEST() local
1890 restored_cache.LookupStale(key, base::TimeTicks::Now(), &stale); in TEST()