Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Unified Diff: net/tools/quic/quic_in_memory_cache_test.cc

Issue 1819853003: QUIC - extend QuicInMemoryCache so that simple server can do server push. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix asan detected bug Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/tools/quic/quic_simple_server_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: 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 ac9319eef1bf3779906e43f71d69146d670faa6b..5f2f96da412039fde03821c83fb49baebb8a4ff2 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 =
« no previous file with comments | « net/tools/quic/quic_in_memory_cache.cc ('k') | net/tools/quic/quic_simple_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698