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

Side by Side Diff: net/base/filter_unittest.cc

Issue 18780: Adjust SDCH problem code histogram.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/filter.cc ('k') | net/base/sdch_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/filter.h" 5 #include "net/base/filter.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 class FilterTest : public testing::Test { 8 class FilterTest : public testing::Test {
9 }; 9 };
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 TEST(FilterTest, MissingSdchEncoding) { 116 TEST(FilterTest, MissingSdchEncoding) {
117 // Handle interesting case where entire SDCH encoding assertion "got lost." 117 // Handle interesting case where entire SDCH encoding assertion "got lost."
118 const bool is_sdch_response = true; 118 const bool is_sdch_response = true;
119 const std::string kTextHtmlMime("text/html"); 119 const std::string kTextHtmlMime("text/html");
120 std::vector<Filter::FilterType> encoding_types; 120 std::vector<Filter::FilterType> encoding_types;
121 121
122 // Loss of encoding, but it was an SDCH response with html type. 122 // Loss of encoding, but it was an SDCH response with html type.
123 encoding_types.clear(); 123 encoding_types.clear();
124 Filter::FixupEncodingTypes(is_sdch_response, kTextHtmlMime, &encoding_types); 124 Filter::FixupEncodingTypes(is_sdch_response, kTextHtmlMime, &encoding_types);
125 EXPECT_EQ(2U, encoding_types.size()); 125 EXPECT_EQ(2U, encoding_types.size());
126 EXPECT_EQ(Filter::FILTER_TYPE_SDCH, encoding_types[0]); 126 EXPECT_EQ(Filter::FILTER_TYPE_SDCH_POSSIBLE, encoding_types[0]);
127 EXPECT_EQ(Filter::FILTER_TYPE_GZIP_HELPING_SDCH, encoding_types[1]); 127 EXPECT_EQ(Filter::FILTER_TYPE_GZIP_HELPING_SDCH, encoding_types[1]);
128 128
129 // No encoding, but it was an SDCH response with non-html type. 129 // No encoding, but it was an SDCH response with non-html type.
130 encoding_types.clear(); 130 encoding_types.clear();
131 Filter::FixupEncodingTypes(is_sdch_response, "other/mime", &encoding_types); 131 Filter::FixupEncodingTypes(is_sdch_response, "other/mime", &encoding_types);
132 EXPECT_TRUE(encoding_types.empty()); 132 EXPECT_TRUE(encoding_types.empty());
133 } 133 }
OLDNEW
« no previous file with comments | « net/base/filter.cc ('k') | net/base/sdch_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698