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

Unified Diff: net/url_request/url_request_job_unittest.cc

Issue 1662763002: [ON HOLD] Implement pull-based design for content decoding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor common logic Created 4 years, 10 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_job_unittest.cc
diff --git a/net/url_request/url_request_job_unittest.cc b/net/url_request/url_request_job_unittest.cc
index 37a457f5090e724bcedee005eaefeb11d934a7ec..e9d79a400f989820f11a8738b3542a04806a824a 100644
--- a/net/url_request/url_request_job_unittest.cc
+++ b/net/url_request/url_request_job_unittest.cc
@@ -60,6 +60,15 @@ void BrotliHelloServer(const HttpRequestInfo* request,
response_data->assign(kBrotliHelloData, sizeof(kBrotliHelloData) - 1);
}
+const MockTransaction kNoFilter_Transaction = {
+ "http://www.google.com/gzyp", "GET", base::Time(), "", LOAD_NORMAL,
+ "HTTP/1.1 200 OK",
+ "Cache-Control: max-age=10000\n"
+ "Content-Length: 30\n", // Intentionally wrong.
+ base::Time(),
+ "hello", TEST_MODE_NORMAL, nullptr, nullptr, 0, 0, OK,
+};
+
const MockTransaction kGZip_Transaction = {
"http://www.google.com/gzyp",
"GET",
@@ -146,6 +155,26 @@ const MockTransaction kBrotli_Slow_Transaction = {
} // namespace
+TEST(URLRequestJob, TransactionNoFilter) {
+ MockNetworkLayer network_layer;
+ TestURLRequestContext context;
+ context.set_http_transaction_factory(&network_layer);
+
+ TestDelegate d;
+ scoped_ptr<URLRequest> req(context.CreateRequest(
+ GURL(kNoFilter_Transaction.url), DEFAULT_PRIORITY, &d));
+ AddMockTransaction(&kNoFilter_Transaction);
+
+ req->set_method("GET");
+ req->Start();
+
+ base::MessageLoop::current()->Run();
+
+ EXPECT_TRUE(network_layer.done_reading_called());
+
+ RemoveMockTransaction(&kNoFilter_Transaction);
+}
+
TEST(URLRequestJob, TransactionNotifiedWhenDone) {
MockNetworkLayer network_layer;
TestURLRequestContext context;

Powered by Google App Engine
This is Rietveld 408576698