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

Unified Diff: net/url_request/url_request_http_job_unittest.cc

Issue 2753453003: Reject unadvertised encodings (Closed)
Patch Set: Extracted code for UMA reporting Created 3 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
Index: net/url_request/url_request_http_job_unittest.cc
diff --git a/net/url_request/url_request_http_job_unittest.cc b/net/url_request/url_request_http_job_unittest.cc
index 0519f2e5392b453f1899900af301dce90955c18f..452a59514b2025ec7e9e6c390a7a049213949a40 100644
--- a/net/url_request/url_request_http_job_unittest.cc
+++ b/net/url_request/url_request_http_job_unittest.cc
@@ -142,8 +142,7 @@ TEST_F(URLRequestHttpJobSetUpSourceTest, SetUpSourceFails) {
EXPECT_EQ(ERR_CONTENT_DECODING_INIT_FAILED, delegate_.request_status());
}
-// Tests that if there is an unknown content-encoding type, the raw response
-// body is passed through.
+// Tests that if there is an unknown content-encoding type.
TEST_F(URLRequestHttpJobSetUpSourceTest, UnknownEncoding) {
MockWrite writes[] = {MockWrite(kSimpleGetMockWrite)};
MockRead reads[] = {MockRead("HTTP/1.1 200 OK\r\n"
@@ -163,8 +162,7 @@ TEST_F(URLRequestHttpJobSetUpSourceTest, UnknownEncoding) {
request->Start();
base::RunLoop().Run();
- EXPECT_EQ(OK, delegate_.request_status());
- EXPECT_EQ("Test Content", delegate_.data_received());
+ EXPECT_EQ(ERR_CONTENT_DECODING_FAILED, delegate_.request_status());
}
// Received a malformed SDCH encoded response when there is no SdchManager.
@@ -190,9 +188,7 @@ TEST_F(URLRequestHttpJobSetUpSourceTest, SdchNotAdvertisedGotSdchResponse) {
request->Start();
base::RunLoop().Run();
- // Pass through the raw response the same way as if received unknown encoding.
- EXPECT_EQ(OK, delegate_.request_status());
- EXPECT_EQ("Test Content", delegate_.data_received());
+ EXPECT_EQ(ERR_CONTENT_DECODING_FAILED, delegate_.request_status());
}
class URLRequestHttpJobTest : public ::testing::Test {

Powered by Google App Engine
This is Rietveld 408576698