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

Unified Diff: net/filter/filter_unittest.cc

Issue 711753003: Pin dictionaries from being deleted while request is outstanding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Integrated Ryan's comments. Created 6 years, 1 month 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/filter/filter.cc ('k') | net/filter/mock_filter_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/filter/filter_unittest.cc
diff --git a/net/filter/filter_unittest.cc b/net/filter/filter_unittest.cc
index 506284d65e481dace5bf04dff648efc2deebf690..79dc3fd5d69b8e4e542283638a14bd38dad9c298 100644
--- a/net/filter/filter_unittest.cc
+++ b/net/filter/filter_unittest.cc
@@ -24,9 +24,6 @@ class PassThroughFilter : public Filter {
} // namespace
-class FilterTest : public testing::Test {
-};
-
TEST(FilterTest, ContentTypeId) {
// Check for basic translation of Content-Encoding, including case variations.
EXPECT_EQ(Filter::FILTER_TYPE_DEFLATE,
@@ -54,7 +51,7 @@ TEST(FilterTest, ContentTypeId) {
// Check various fixups that modify content encoding lists.
TEST(FilterTest, ApacheGzip) {
MockFilterContext filter_context;
- filter_context.SetSdchResponse(false);
+ filter_context.SetSdchResponse(NULL);
// Check that redundant gzip mime type removes only solo gzip encoding.
const std::string kGzipMime1("application/x-gzip");
@@ -100,7 +97,7 @@ TEST(FilterTest, ApacheGzip) {
TEST(FilterTest, GzipContentDispositionFilename) {
MockFilterContext filter_context;
- filter_context.SetSdchResponse(false);
+ filter_context.SetSdchResponse(NULL);
const std::string kGzipMime("application/x-tar");
const std::string kContentDisposition("attachment; filename=\"foo.tgz\"");
@@ -119,7 +116,9 @@ TEST(FilterTest, SdchEncoding) {
// Handle content encodings including SDCH.
const std::string kTextHtmlMime("text/html");
MockFilterContext filter_context;
- filter_context.SetSdchResponse(true);
+ // Empty handle indicates to filter that SDCH is active.
+ filter_context.SetSdchResponse(
+ SdchManager::CreateEmptyDictionarySetForTesting().Pass());
std::vector<Filter::FilterType> encoding_types;
@@ -156,7 +155,8 @@ TEST(FilterTest, MissingSdchEncoding) {
// Handle interesting case where entire SDCH encoding assertion "got lost."
const std::string kTextHtmlMime("text/html");
MockFilterContext filter_context;
- filter_context.SetSdchResponse(true);
+ filter_context.SetSdchResponse(
+ SdchManager::CreateEmptyDictionarySetForTesting().Pass());
std::vector<Filter::FilterType> encoding_types;
@@ -169,7 +169,7 @@ TEST(FilterTest, MissingSdchEncoding) {
EXPECT_EQ(Filter::FILTER_TYPE_GZIP_HELPING_SDCH, encoding_types[1]);
// Loss of encoding, but it was an SDCH response with a prefix that says it
- // was an html type. Note that it *should* be the case that a precise match
+ // was an html type. Note that it *should* be the case that a precise match
// with "text/html" we be collected by GetMimeType() and passed in, but we
// coded the fixup defensively (scanning for a prefix of "text/html", so this
// is an example which could survive such confusion in the caller).
« no previous file with comments | « net/filter/filter.cc ('k') | net/filter/mock_filter_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698