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

Unified Diff: net/http/http_response_body_drainer_unittest.cc

Issue 8591037: Implement Drain() on HttpPipelinedStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Skip on unusable Created 9 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/http/http_response_body_drainer.cc ('k') | net/http/http_response_headers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_body_drainer_unittest.cc
diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc
index f580f94617cf6d9d1fb00184d07d57506a4be9d9..7568944c9c9693162fe328f4078b3af729a1b4c0 100644
--- a/net/http/http_response_body_drainer_unittest.cc
+++ b/net/http/http_response_body_drainer_unittest.cc
@@ -255,6 +255,24 @@ TEST_F(HttpResponseBodyDrainerTest, DrainBodyTooLarge) {
EXPECT_TRUE(result_waiter_.WaitForResult());
}
+TEST_F(HttpResponseBodyDrainerTest, StartBodyTooLarge) {
+ TestOldCompletionCallback callback;
+ int too_many_chunks =
+ HttpResponseBodyDrainer::kDrainBodyBufferSize / kMagicChunkSize;
+ too_many_chunks += 1; // Now it's too large.
+
+ mock_stream_->set_num_chunks(0);
+ drainer_->StartWithSize(session_, too_many_chunks * kMagicChunkSize);
+ EXPECT_TRUE(result_waiter_.WaitForResult());
+}
+
+TEST_F(HttpResponseBodyDrainerTest, StartWithNothingToDo) {
+ TestOldCompletionCallback callback;
+ mock_stream_->set_num_chunks(0);
+ drainer_->StartWithSize(session_, 0);
+ EXPECT_FALSE(result_waiter_.WaitForResult());
+}
+
} // namespace
} // namespace net
« no previous file with comments | « net/http/http_response_body_drainer.cc ('k') | net/http/http_response_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698