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

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

Issue 2651673004: Add quic_map_util. (Closed)
Patch Set: Created 3 years, 11 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_http_response_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_http_response_cache_test.cc
diff --git a/net/tools/quic/quic_http_response_cache_test.cc b/net/tools/quic/quic_http_response_cache_test.cc
index fa2fce6da94190dad8fed5aa842c468291f5f795..c0f5347f5c76a93058708b311b0d4069c3312e9b 100644
--- a/net/tools/quic/quic_http_response_cache_test.cc
+++ b/net/tools/quic/quic_http_response_cache_test.cc
@@ -7,14 +7,13 @@
#include "base/files/file_path.h"
#include "base/memory/singleton.h"
#include "base/path_service.h"
-#include "base/stl_util.h"
+#include "net/quic/platform/api/quic_map_util.h"
#include "net/quic/platform/api/quic_str_cat.h"
#include "net/quic/platform/api/quic_text_utils.h"
#include "net/spdy/spdy_framer.h"
#include "net/tools/quic/quic_http_response_cache.h"
#include "testing/gtest/include/gtest/gtest.h"
-using base::ContainsKey;
using base::StringPiece;
using net::SpdyHeaderBlock;
using std::string;
@@ -63,7 +62,7 @@ TEST_F(QuicHttpResponseCacheTest, AddSimpleResponseGetResponse) {
const QuicHttpResponseCache::Response* response =
cache_.GetResponse("www.google.com", "/");
ASSERT_TRUE(response);
- ASSERT_TRUE(ContainsKey(response->headers(), ":status"));
+ ASSERT_TRUE(QuicContainsKey(response->headers(), ":status"));
EXPECT_EQ("200", response->headers().find(":status")->second);
EXPECT_EQ(response_body.size(), response->body().length());
}
@@ -99,10 +98,10 @@ TEST_F(QuicHttpResponseCacheTest, ReadsCacheDir) {
const QuicHttpResponseCache::Response* response =
cache_.GetResponse("www.example.com", "/index.html");
ASSERT_TRUE(response);
- ASSERT_TRUE(ContainsKey(response->headers(), ":status"));
+ ASSERT_TRUE(QuicContainsKey(response->headers(), ":status"));
EXPECT_EQ("200", response->headers().find(":status")->second);
// Connection headers are not valid in HTTP/2.
- EXPECT_FALSE(ContainsKey(response->headers(), "connection"));
+ EXPECT_FALSE(QuicContainsKey(response->headers(), "connection"));
EXPECT_LT(0U, response->body().length());
}
@@ -125,10 +124,10 @@ TEST_F(QuicHttpResponseCacheTest, UsesOriginalUrl) {
const QuicHttpResponseCache::Response* response =
cache_.GetResponse("www.example.com", "/site_map.html");
ASSERT_TRUE(response);
- ASSERT_TRUE(ContainsKey(response->headers(), ":status"));
+ ASSERT_TRUE(QuicContainsKey(response->headers(), ":status"));
EXPECT_EQ("200", response->headers().find(":status")->second);
// Connection headers are not valid in HTTP/2.
- EXPECT_FALSE(ContainsKey(response->headers(), "connection"));
+ EXPECT_FALSE(QuicContainsKey(response->headers(), "connection"));
EXPECT_LT(0U, response->body().length());
}
@@ -151,20 +150,20 @@ TEST_F(QuicHttpResponseCacheTest, DefaultResponse) {
// Now we should get the default response for the original request.
response = cache_.GetResponse("www.google.com", "/");
ASSERT_TRUE(response);
- ASSERT_TRUE(ContainsKey(response->headers(), ":status"));
+ ASSERT_TRUE(QuicContainsKey(response->headers(), ":status"));
EXPECT_EQ("200", response->headers().find(":status")->second);
// Now add a set response for / and make sure it is returned
cache_.AddSimpleResponse("www.google.com", "/", 302, "");
response = cache_.GetResponse("www.google.com", "/");
ASSERT_TRUE(response);
- ASSERT_TRUE(ContainsKey(response->headers(), ":status"));
+ ASSERT_TRUE(QuicContainsKey(response->headers(), ":status"));
EXPECT_EQ("302", response->headers().find(":status")->second);
// We should get the default response for other requests.
response = cache_.GetResponse("www.google.com", "/asd");
ASSERT_TRUE(response);
- ASSERT_TRUE(ContainsKey(response->headers(), ":status"));
+ ASSERT_TRUE(QuicContainsKey(response->headers(), ":status"));
EXPECT_EQ("200", response->headers().find(":status")->second);
}
@@ -238,7 +237,7 @@ TEST_F(QuicHttpResponseCacheTest, GetServerPushResourcesAndPushResponses) {
const QuicHttpResponseCache::Response* response =
cache_.GetResponse(host, path);
ASSERT_TRUE(response);
- ASSERT_TRUE(ContainsKey(response->headers(), ":status"));
+ ASSERT_TRUE(QuicContainsKey(response->headers(), ":status"));
EXPECT_EQ(push_response_status[i++],
response->headers().find(":status")->second);
EXPECT_EQ(push_resource.body, response->body());
« no previous file with comments | « net/tools/quic/quic_http_response_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