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

Unified Diff: net/http/http_stream_parser_unittest.cc

Issue 9284033: net: Give more descriptive names for code around the request merging logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« net/base/upload_data.cc ('K') | « net/http/http_stream_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_parser_unittest.cc
diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc
index 1e96038c06493ea3ff9f4730c8ebd2434d7c46bf..808a3e3d83a248947b70b9207a248e7cc9f9fa02 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -79,20 +79,22 @@ TEST(HttpStreamParser, EncodeChunk_TooLargePayload) {
ASSERT_EQ(ERR_INVALID_ARGUMENT, num_bytes_written);
}
-TEST(HttpStreamParser, ShouldMerge_NoBody) {
+TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_NoBody) {
// Shouldn't be merged if upload data is non-existent.
- ASSERT_FALSE(HttpStreamParser::ShouldMerge("some header", NULL));
+ ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
+ "some header", NULL));
}
-TEST(HttpStreamParser, ShouldMerge_EmptyBody) {
+TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_EmptyBody) {
scoped_refptr<UploadData> upload_data = new UploadData;
scoped_ptr<UploadDataStream> body(
UploadDataStream::Create(upload_data.get(), NULL));
// Shouldn't be merged if upload data is empty.
- ASSERT_FALSE(HttpStreamParser::ShouldMerge("some header", body.get()));
+ ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
+ "some header", body.get()));
}
-TEST(HttpStreamParser, ShouldMerge_ChunkedBody) {
+TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_ChunkedBody) {
scoped_refptr<UploadData> upload_data = new UploadData;
upload_data->set_is_chunked(true);
const std::string payload = "123";
@@ -101,10 +103,11 @@ TEST(HttpStreamParser, ShouldMerge_ChunkedBody) {
scoped_ptr<UploadDataStream> body(
UploadDataStream::Create(upload_data.get(), NULL));
// Shouldn't be merged if upload data carries chunked data.
- ASSERT_FALSE(HttpStreamParser::ShouldMerge("some header", body.get()));
+ ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
+ "some header", body.get()));
}
-TEST(HttpStreamParser, ShouldMerge_FileBody) {
+TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_FileBody) {
scoped_refptr<UploadData> upload_data = new UploadData;
// Create an empty temporary file.
@@ -119,10 +122,11 @@ TEST(HttpStreamParser, ShouldMerge_FileBody) {
scoped_ptr<UploadDataStream> body(
UploadDataStream::Create(upload_data.get(), NULL));
// Shouldn't be merged if upload data carries a file, as it's not in-memory.
- ASSERT_FALSE(HttpStreamParser::ShouldMerge("some header", body.get()));
+ ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
+ "some header", body.get()));
}
-TEST(HttpStreamParser, ShouldMerge_SmallBodyInMemory) {
+TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_SmallBodyInMemory) {
scoped_refptr<UploadData> upload_data = new UploadData;
const std::string payload = "123";
upload_data->AppendBytes(payload.data(), payload.size());
@@ -130,10 +134,11 @@ TEST(HttpStreamParser, ShouldMerge_SmallBodyInMemory) {
scoped_ptr<UploadDataStream> body(
UploadDataStream::Create(upload_data.get(), NULL));
// Yes, should be merged if the in-memory body is small here.
- ASSERT_TRUE(HttpStreamParser::ShouldMerge("some header", body.get()));
+ ASSERT_TRUE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
+ "some header", body.get()));
}
-TEST(HttpStreamParser, ShouldMerge_LargeBodyInMemory) {
+TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_LargeBodyInMemory) {
scoped_refptr<UploadData> upload_data = new UploadData;
const std::string payload(10000, 'a'); // 'a' x 10000.
upload_data->AppendBytes(payload.data(), payload.size());
@@ -141,7 +146,8 @@ TEST(HttpStreamParser, ShouldMerge_LargeBodyInMemory) {
scoped_ptr<UploadDataStream> body(
UploadDataStream::Create(upload_data.get(), NULL));
// Shouldn't be merged if the in-memory body is large here.
- ASSERT_FALSE(HttpStreamParser::ShouldMerge("some header", body.get()));
+ ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
+ "some header", body.get()));
}
} // namespace net
« net/base/upload_data.cc ('K') | « net/http/http_stream_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698