summaryrefslogtreecommitdiffstats
path: root/net/tools/quic/quic_in_memory_cache_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/tools/quic/quic_in_memory_cache_test.cc')
-rw-r--r--net/tools/quic/quic_in_memory_cache_test.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/net/tools/quic/quic_in_memory_cache_test.cc b/net/tools/quic/quic_in_memory_cache_test.cc
index ac9319e..5f2f96d 100644
--- a/net/tools/quic/quic_in_memory_cache_test.cc
+++ b/net/tools/quic/quic_in_memory_cache_test.cc
@@ -112,6 +112,24 @@ TEST_F(QuicInMemoryCacheTest, ReadsCacheDir) {
EXPECT_LT(0U, response->body().length());
}
+TEST_F(QuicInMemoryCacheTest, ReadsCacheDirWithServerPushResource) {
+ QuicInMemoryCache::GetInstance()->InitializeFromDirectory(CacheDirectory() +
+ "_with_push");
+ QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance();
+ std::list<ServerPushInfo> resources =
+ cache->GetServerPushResources("quic.test.url/");
+ ASSERT_EQ(1UL, resources.size());
+}
+
+TEST_F(QuicInMemoryCacheTest, ReadsCacheDirWithServerPushResources) {
+ QuicInMemoryCache::GetInstance()->InitializeFromDirectory(CacheDirectory() +
+ "_with_push");
+ QuicInMemoryCache* cache = QuicInMemoryCache::GetInstance();
+ std::list<ServerPushInfo> resources =
+ cache->GetServerPushResources("quic.test.url/index2.html");
+ ASSERT_EQ(2UL, resources.size());
+}
+
TEST_F(QuicInMemoryCacheTest, UsesOriginalUrl) {
QuicInMemoryCache::GetInstance()->InitializeFromDirectory(CacheDirectory());
const QuicInMemoryCache::Response* response =