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

Unified Diff: net/http/http_stream_parser_unittest.cc

Issue 10913179: net: Make UploadDataStream::Init() asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed argument order Created 8 years, 3 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
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/spdy/spdy_http_stream_spdy2_unittest.cc » ('j') | 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 b6cb77885e9267f60ff22042dcceaa7e4bd3e3b6..9ef3cc7c26e8e71556b2697dbd740530d0eefde3 100644
--- a/net/http/http_stream_parser_unittest.cc
+++ b/net/http/http_stream_parser_unittest.cc
@@ -97,7 +97,7 @@ TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_NoBody) {
TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_EmptyBody) {
scoped_refptr<UploadData> upload_data = new UploadData;
scoped_ptr<UploadDataStream> body(new UploadDataStream(upload_data));
- ASSERT_EQ(OK, body->Init());
+ ASSERT_EQ(OK, body->InitSync());
// Shouldn't be merged if upload data is empty.
ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
"some header", body.get()));
@@ -110,7 +110,7 @@ TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_ChunkedBody) {
upload_data->AppendChunk(payload.data(), payload.size(), true);
scoped_ptr<UploadDataStream> body(new UploadDataStream(upload_data));
- ASSERT_EQ(OK, body->Init());
+ ASSERT_EQ(OK, body->InitSync());
// Shouldn't be merged if upload data carries chunked data.
ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
"some header", body.get()));
@@ -129,7 +129,7 @@ TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_FileBody) {
upload_data->AppendFileRange(temp_file_path, 0, 0, base::Time());
scoped_ptr<UploadDataStream> body(new UploadDataStream(upload_data));
- ASSERT_EQ(OK, body->Init());
+ ASSERT_EQ(OK, body->InitSync());
// Shouldn't be merged if upload data carries a file, as it's not in-memory.
ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
"some header", body.get()));
@@ -141,7 +141,7 @@ TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_SmallBodyInMemory) {
upload_data->AppendBytes(payload.data(), payload.size());
scoped_ptr<UploadDataStream> body(new UploadDataStream(upload_data));
- ASSERT_EQ(OK, body->Init());
+ ASSERT_EQ(OK, body->InitSync());
// Yes, should be merged if the in-memory body is small here.
ASSERT_TRUE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
"some header", body.get()));
@@ -153,7 +153,7 @@ TEST(HttpStreamParser, ShouldMergeRequestHeadersAndBody_LargeBodyInMemory) {
upload_data->AppendBytes(payload.data(), payload.size());
scoped_ptr<UploadDataStream> body(new UploadDataStream(upload_data));
- ASSERT_EQ(OK, body->Init());
+ ASSERT_EQ(OK, body->InitSync());
// Shouldn't be merged if the in-memory body is large here.
ASSERT_FALSE(HttpStreamParser::ShouldMergeRequestHeadersAndBody(
"some header", body.get()));
@@ -226,7 +226,7 @@ TEST(HttpStreamParser, AsyncChunkAndAsyncSocket) {
scoped_ptr<UploadDataStream> upload_stream(
new UploadDataStream(upload_data));
- ASSERT_EQ(OK, upload_stream->Init());
+ ASSERT_EQ(OK, upload_stream->InitSync());
HttpRequestHeaders request_headers;
request_headers.SetHeader("Host", "localhost");
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/spdy/spdy_http_stream_spdy2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698