From 80c695397c352cefbd00f127e3f1bee2626cf3d2 Mon Sep 17 00:00:00 2001 From: ckrasic Date: Mon, 21 Mar 2016 17:34:49 -0700 Subject: QUIC - extend QuicInMemoryCache so that simple server can do server push. Merge internal change: 117591398 BUG= Review URL: https://codereview.chromium.org/1819853003 Cr-Commit-Position: refs/heads/master@{#382458} --- net/tools/quic/quic_in_memory_cache_test.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'net/tools/quic/quic_in_memory_cache_test.cc') 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 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 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 = -- cgit v1.1