summaryrefslogtreecommitdiffstats
path: root/net/tools/quic/quic_in_memory_cache_test.cc
diff options
context:
space:
mode:
authorckrasic <ckrasic@chromium.org>2016-03-21 17:34:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-22 00:36:33 +0000
commit80c695397c352cefbd00f127e3f1bee2626cf3d2 (patch)
treed4a4d1abdefa6a7a4428abe9e22a77abfc0baf84 /net/tools/quic/quic_in_memory_cache_test.cc
parentcee67051c2c03f202ffad75332f94b4f2b33a4de (diff)
downloadchromium_src-80c695397c352cefbd00f127e3f1bee2626cf3d2.zip
chromium_src-80c695397c352cefbd00f127e3f1bee2626cf3d2.tar.gz
chromium_src-80c695397c352cefbd00f127e3f1bee2626cf3d2.tar.bz2
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}
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 =