summaryrefslogtreecommitdiffstats
path: root/net/http/http_pipelined_connection_impl_unittest.cc
diff options
context:
space:
mode:
authorhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 11:48:13 +0000
committerhashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-01 11:48:13 +0000
commit9a96389e66421f3c76b5349acaf78ab94eb322f1 (patch)
treeaea208c6f5f48ddff94125662838d1d385a242ec /net/http/http_pipelined_connection_impl_unittest.cc
parent4ab7f1754de68fc87217a99a55f46d5d180f0b9a (diff)
downloadchromium_src-9a96389e66421f3c76b5349acaf78ab94eb322f1.zip
chromium_src-9a96389e66421f3c76b5349acaf78ab94eb322f1.tar.gz
chromium_src-9a96389e66421f3c76b5349acaf78ab94eb322f1.tar.bz2
net: Stop passing ownership of UploadDataStream from HttpNetworkTransaction to HttpStream
This change is a preparation step before moving ownership of UploadDataStream to URLRequest. HttpStream::SendRequest takes UploadDataStream* instead of scoped_ptr<UploadDataStream>. HttpNetworkTransaction does not release the ownership of UploadDataStream. Some include cleanups. BUG=155242 TEST=net_unittests Review URL: https://chromiumcodereview.appspot.com/11269066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165337 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_pipelined_connection_impl_unittest.cc')
-rw-r--r--net/http/http_pipelined_connection_impl_unittest.cc308
1 files changed, 122 insertions, 186 deletions
diff --git a/net/http/http_pipelined_connection_impl_unittest.cc b/net/http/http_pipelined_connection_impl_unittest.cc
index 36384ad..0256efa 100644
--- a/net/http/http_pipelined_connection_impl_unittest.cc
+++ b/net/http/http_pipelined_connection_impl_unittest.cc
@@ -12,7 +12,6 @@
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/request_priority.h"
-#include "net/base/upload_data_stream.h"
#include "net/http/http_pipelined_stream.h"
#include "net/socket/client_socket_handle.h"
#include "net/socket/client_socket_pool_histograms.h"
@@ -138,9 +137,8 @@ class HttpPipelinedConnectionImplTest : public testing::Test {
const std::string& filename) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK, stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ EXPECT_EQ(OK, stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
EXPECT_EQ(OK, stream->ReadResponseHeaders(callback_.callback()));
ExpectResponse(filename, stream, false);
@@ -211,9 +209,8 @@ TEST_F(HttpPipelinedConnectionImplTest, AsyncSingleRequest) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(ERR_IO_PENDING,
- stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
data_->RunFor(1);
EXPECT_LE(OK, callback_.WaitForResult());
@@ -246,15 +243,13 @@ TEST_F(HttpPipelinedConnectionImplTest, LockStepAsyncRequests) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(ERR_IO_PENDING,
- stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
- &response1, callback_.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream1->SendRequest(headers1, NULL, &response1,
+ callback_.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
- EXPECT_EQ(ERR_IO_PENDING,
- stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
- &response2, callback_.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream2->SendRequest(headers2, NULL, &response2,
+ callback_.callback()));
data_->RunFor(1);
EXPECT_LE(OK, callback_.WaitForResult());
@@ -300,14 +295,12 @@ TEST_F(HttpPipelinedConnectionImplTest, TwoResponsesInOnePacket) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(OK,
- stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
- &response1, callback_.callback()));
+ EXPECT_EQ(OK, stream1->SendRequest(headers1, NULL,
+ &response1, callback_.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
- EXPECT_EQ(OK,
- stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
- &response2, callback_.callback()));
+ EXPECT_EQ(OK, stream2->SendRequest(headers2, NULL,
+ &response2, callback_.callback()));
EXPECT_EQ(OK, stream1->ReadResponseHeaders(callback_.callback()));
ExpectResponse("ok.html", stream1, false);
@@ -360,12 +353,12 @@ TEST_F(HttpPipelinedConnectionImplTest, ReadOrderSwapped) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(OK, stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream1->SendRequest(headers1, NULL,
&response1, callback_.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
- EXPECT_EQ(OK, stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream2->SendRequest(headers2, NULL,
&response2, callback_.callback()));
EXPECT_EQ(ERR_IO_PENDING, stream2->ReadResponseHeaders(callback_.callback()));
@@ -401,13 +394,13 @@ TEST_F(HttpPipelinedConnectionImplTest, SendWhileReading) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(OK, stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream1->SendRequest(headers1, NULL,
&response1, callback_.callback()));
EXPECT_EQ(OK, stream1->ReadResponseHeaders(callback_.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
- EXPECT_EQ(OK, stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream2->SendRequest(headers2, NULL,
&response2, callback_.callback()));
ExpectResponse("ok.html", stream1, false);
@@ -438,7 +431,7 @@ TEST_F(HttpPipelinedConnectionImplTest, AsyncSendWhileAsyncReadBlocked) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(OK, stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream1->SendRequest(headers1, NULL,
&response1, callback_.callback()));
EXPECT_EQ(OK, stream1->ReadResponseHeaders(callback_.callback()));
TestCompletionCallback callback1;
@@ -451,9 +444,8 @@ TEST_F(HttpPipelinedConnectionImplTest, AsyncSendWhileAsyncReadBlocked) {
HttpRequestHeaders headers2;
HttpResponseInfo response2;
TestCompletionCallback callback2;
- EXPECT_EQ(ERR_IO_PENDING,
- stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
- &response2, callback2.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream2->SendRequest(headers2, NULL, &response2,
+ callback2.callback()));
data_->RunFor(1);
EXPECT_LE(OK, callback2.WaitForResult());
@@ -508,16 +500,15 @@ TEST_F(HttpPipelinedConnectionImplTest, UnsentStreamAllowsLaterUse) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(ERR_IO_PENDING,
- stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
scoped_ptr<HttpStream> unsent_stream(NewTestStream("unsent.html"));
HttpRequestHeaders unsent_headers;
HttpResponseInfo unsent_response;
EXPECT_EQ(ERR_IO_PENDING,
unsent_stream->SendRequest(unsent_headers,
- scoped_ptr<UploadDataStream>(),
+ NULL,
&unsent_response,
callback_.callback()));
unsent_stream->Close(false);
@@ -553,27 +544,24 @@ TEST_F(HttpPipelinedConnectionImplTest, FailedSend) {
HttpResponseInfo response;
TestCompletionCallback failed_callback;
EXPECT_EQ(ERR_IO_PENDING,
- failed_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
+ failed_stream->SendRequest(headers, NULL,
&response, failed_callback.callback()));
TestCompletionCallback evicted_callback;
EXPECT_EQ(ERR_IO_PENDING,
evicted_stream->SendRequest(headers,
- scoped_ptr<UploadDataStream>(),
+ NULL,
&response,
evicted_callback.callback()));
- EXPECT_EQ(ERR_IO_PENDING,
- closed_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response,
- callback_.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, closed_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
closed_stream->Close(false);
data_->RunFor(1);
EXPECT_EQ(ERR_FAILED, failed_callback.WaitForResult());
EXPECT_EQ(ERR_PIPELINE_EVICTION, evicted_callback.WaitForResult());
EXPECT_EQ(ERR_PIPELINE_EVICTION,
- rejected_stream->SendRequest(headers,
- scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ rejected_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
failed_stream->Close(true);
evicted_stream->Close(true);
@@ -607,27 +595,20 @@ TEST_F(HttpPipelinedConnectionImplTest, ConnectionSuddenlyClosedAfterResponse) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- closed_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- read_evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
- EXPECT_EQ(OK,
- read_rejected_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ EXPECT_EQ(OK, closed_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
+ EXPECT_EQ(OK, read_evicted_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
+ EXPECT_EQ(OK, read_rejected_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
TestCompletionCallback send_closed_callback;
EXPECT_EQ(ERR_IO_PENDING,
- send_closed_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- send_closed_callback.callback()));
+ send_closed_stream->SendRequest(headers, NULL, &response,
+ send_closed_callback.callback()));
TestCompletionCallback send_evicted_callback;
EXPECT_EQ(ERR_IO_PENDING,
- send_evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- send_evicted_callback.callback()));
+ send_evicted_stream->SendRequest(headers, NULL, &response,
+ send_evicted_callback.callback()));
TestCompletionCallback read_evicted_callback;
EXPECT_EQ(ERR_IO_PENDING,
@@ -653,9 +634,8 @@ TEST_F(HttpPipelinedConnectionImplTest, ConnectionSuddenlyClosedAfterResponse) {
send_evicted_stream->Close(true);
EXPECT_EQ(ERR_PIPELINE_EVICTION,
- send_rejected_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ send_rejected_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
send_rejected_stream->Close(true);
}
@@ -672,14 +652,12 @@ TEST_F(HttpPipelinedConnectionImplTest, AbortWhileSending) {
HttpResponseInfo response;
TestCompletionCallback aborted_callback;
EXPECT_EQ(ERR_IO_PENDING,
- aborted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- aborted_callback.callback()));
+ aborted_stream->SendRequest(headers, NULL, &response,
+ aborted_callback.callback()));
TestCompletionCallback evicted_callback;
EXPECT_EQ(ERR_IO_PENDING,
- evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- evicted_callback.callback()));
+ evicted_stream->SendRequest(headers, NULL, &response,
+ evicted_callback.callback()));
aborted_stream->Close(true);
EXPECT_EQ(ERR_PIPELINE_EVICTION, evicted_callback.WaitForResult());
@@ -701,19 +679,16 @@ TEST_F(HttpPipelinedConnectionImplTest, AbortWhileSendingSecondRequest) {
HttpRequestHeaders headers;
HttpResponseInfo response;
TestCompletionCallback ok_callback;
- EXPECT_EQ(ERR_IO_PENDING,
- ok_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, ok_callback.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, ok_stream->SendRequest(headers, NULL, &response,
+ ok_callback.callback()));
TestCompletionCallback aborted_callback;
EXPECT_EQ(ERR_IO_PENDING,
- aborted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- aborted_callback.callback()));
+ aborted_stream->SendRequest(headers, NULL, &response,
+ aborted_callback.callback()));
TestCompletionCallback evicted_callback;
EXPECT_EQ(ERR_IO_PENDING,
- evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- evicted_callback.callback()));
+ evicted_stream->SendRequest(headers, NULL, &response,
+ evicted_callback.callback()));
data_->RunFor(1);
EXPECT_LE(OK, ok_callback.WaitForResult());
@@ -742,13 +717,11 @@ TEST_F(HttpPipelinedConnectionImplTest, AbortWhileReadingHeaders) {
HttpRequestHeaders headers;
HttpResponseInfo response;
EXPECT_EQ(OK,
- aborted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ aborted_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
EXPECT_EQ(OK,
- evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ evicted_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
EXPECT_EQ(ERR_IO_PENDING,
aborted_stream->ReadResponseHeaders(callback_.callback()));
@@ -761,9 +734,8 @@ TEST_F(HttpPipelinedConnectionImplTest, AbortWhileReadingHeaders) {
evicted_stream->Close(true);
EXPECT_EQ(ERR_PIPELINE_EVICTION,
- rejected_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ rejected_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
rejected_stream->Close(true);
}
@@ -786,17 +758,12 @@ TEST_F(HttpPipelinedConnectionImplTest, PendingResponseAbandoned) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- ok_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- abandoned_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
- EXPECT_EQ(OK,
- evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ EXPECT_EQ(OK, ok_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
+ EXPECT_EQ(OK, abandoned_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
+ EXPECT_EQ(OK, evicted_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
EXPECT_EQ(OK, ok_stream->ReadResponseHeaders(callback_.callback()));
TestCompletionCallback abandoned_callback;
@@ -838,13 +805,10 @@ TEST_F(HttpPipelinedConnectionImplTest, DisconnectedAfterOneRequestRecovery) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- ok_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- rejected_read_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ EXPECT_EQ(OK, ok_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
+ EXPECT_EQ(OK, rejected_read_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
EXPECT_EQ(OK, ok_stream->ReadResponseHeaders(callback_.callback()));
ExpectResponse("ok.html", ok_stream, false);
@@ -852,18 +816,16 @@ TEST_F(HttpPipelinedConnectionImplTest, DisconnectedAfterOneRequestRecovery) {
TestCompletionCallback read_callback;
EXPECT_EQ(ERR_IO_PENDING,
- evicted_send_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- read_callback.callback()));
+ evicted_send_stream->SendRequest(headers, NULL, &response,
+ read_callback.callback()));
data_->RunFor(1);
EXPECT_EQ(ERR_PIPELINE_EVICTION, read_callback.WaitForResult());
EXPECT_EQ(ERR_PIPELINE_EVICTION,
rejected_read_stream->ReadResponseHeaders(callback_.callback()));
EXPECT_EQ(ERR_PIPELINE_EVICTION,
- rejected_send_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ rejected_send_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
rejected_read_stream->Close(true);
rejected_send_stream->Close(true);
@@ -887,13 +849,10 @@ TEST_F(HttpPipelinedConnectionImplTest, DisconnectedPendingReadRecovery) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- ok_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ EXPECT_EQ(OK, ok_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
+ EXPECT_EQ(OK, evicted_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
EXPECT_EQ(OK, ok_stream->ReadResponseHeaders(callback_.callback()));
ExpectResponse("ok.html", ok_stream, false);
@@ -926,13 +885,10 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseCalledBeforeNextReadLoop) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- ok_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ EXPECT_EQ(OK, ok_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
+ EXPECT_EQ(OK, evicted_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
EXPECT_EQ(OK, ok_stream->ReadResponseHeaders(callback_.callback()));
ExpectResponse("ok.html", ok_stream, false);
@@ -963,13 +919,10 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseCalledBeforeReadCallback) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- ok_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- evicted_stream->SendRequest(
- headers, scoped_ptr<UploadDataStream>(), &response,
- callback_.callback()));
+ EXPECT_EQ(OK, ok_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
+ EXPECT_EQ(OK, evicted_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
EXPECT_EQ(OK, ok_stream->ReadResponseHeaders(callback_.callback()));
ExpectResponse("ok.html", ok_stream, false);
@@ -1019,9 +972,8 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseCalledDuringSendCallback) {
StreamDeleter deleter(stream);
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(ERR_IO_PENDING,
- stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, deleter.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(headers, NULL, &response,
+ deleter.callback()));
data_->RunFor(1);
}
@@ -1039,7 +991,7 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseCalledDuringReadCallback) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK, stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream->SendRequest(headers, NULL,
&response, callback_.callback()));
StreamDeleter deleter(stream);
@@ -1064,13 +1016,10 @@ TEST_F(HttpPipelinedConnectionImplTest,
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- failed_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- evicted_stream->SendRequest(headers,
- scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(OK, failed_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
+ EXPECT_EQ(OK, evicted_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
StreamDeleter failed_deleter(failed_stream);
EXPECT_EQ(ERR_IO_PENDING,
@@ -1097,13 +1046,10 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseOtherDuringReadCallback) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK, deleter_stream->SendRequest(headers,
- scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, deleter_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
+ EXPECT_EQ(OK, deleted_stream->SendRequest(headers, NULL,
&response, callback_.callback()));
- EXPECT_EQ(OK,
- deleted_stream->SendRequest(headers,
- scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
StreamDeleter deleter(deleted_stream);
EXPECT_EQ(ERR_IO_PENDING,
@@ -1128,7 +1074,7 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseBeforeSendCallbackRuns) {
HttpRequestHeaders headers;
HttpResponseInfo response;
EXPECT_EQ(ERR_IO_PENDING,
- close_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
+ close_stream->SendRequest(headers, NULL,
&response, close_callback->callback()));
data_->RunFor(1);
@@ -1157,9 +1103,8 @@ TEST_F(HttpPipelinedConnectionImplTest, CloseBeforeReadCallbackRuns) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- close_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(OK, close_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
scoped_ptr<TestCompletionCallback> close_callback(
new TestCompletionCallback);
@@ -1189,16 +1134,14 @@ TEST_F(HttpPipelinedConnectionImplTest, AbortWhileSendQueued) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
TestCompletionCallback callback1;
- EXPECT_EQ(ERR_IO_PENDING,
- stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
- &response1, callback1.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream1->SendRequest(headers1, NULL, &response1,
+ callback1.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
TestCompletionCallback callback2;
- EXPECT_EQ(ERR_IO_PENDING,
- stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
- &response2, callback2.callback()));
+ EXPECT_EQ(ERR_IO_PENDING, stream2->SendRequest(headers2, NULL, &response2,
+ callback2.callback()));
stream2.reset();
stream1->Close(true);
@@ -1222,17 +1165,15 @@ TEST_F(HttpPipelinedConnectionImplTest, NoGapBetweenCloseAndEviction) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- close_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(OK, close_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
TestCompletionCallback close_callback;
EXPECT_EQ(ERR_IO_PENDING,
close_stream->ReadResponseHeaders(close_callback.callback()));
- EXPECT_EQ(OK,
- dummy_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(OK, dummy_stream->SendRequest(headers, NULL, &response,
+ callback_.callback()));
TestCompletionCallback dummy_callback;
EXPECT_EQ(ERR_IO_PENDING,
@@ -1270,11 +1211,11 @@ TEST_F(HttpPipelinedConnectionImplTest, RecoverFromDrainOnRedirect) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(OK, stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream1->SendRequest(headers1, NULL,
&response1, callback_.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
- EXPECT_EQ(OK, stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream2->SendRequest(headers2, NULL,
&response2, callback_.callback()));
EXPECT_EQ(OK, stream1->ReadResponseHeaders(callback_.callback()));
@@ -1302,11 +1243,11 @@ TEST_F(HttpPipelinedConnectionImplTest, EvictAfterDrainOfUnknownSize) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(OK, stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream1->SendRequest(headers1, NULL,
&response1, callback_.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
- EXPECT_EQ(OK, stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream2->SendRequest(headers2, NULL,
&response2, callback_.callback()));
EXPECT_EQ(OK, stream1->ReadResponseHeaders(callback_.callback()));
@@ -1335,11 +1276,11 @@ TEST_F(HttpPipelinedConnectionImplTest, EvictAfterFailedDrain) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(OK, stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream1->SendRequest(headers1, NULL,
&response1, callback_.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
- EXPECT_EQ(OK, stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream2->SendRequest(headers2, NULL,
&response2, callback_.callback()));
@@ -1370,11 +1311,11 @@ TEST_F(HttpPipelinedConnectionImplTest, EvictIfDrainingChunkedEncoding) {
HttpRequestHeaders headers1;
HttpResponseInfo response1;
- EXPECT_EQ(OK, stream1->SendRequest(headers1, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream1->SendRequest(headers1, NULL,
&response1, callback_.callback()));
HttpRequestHeaders headers2;
HttpResponseInfo response2;
- EXPECT_EQ(OK, stream2->SendRequest(headers2, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream2->SendRequest(headers2, NULL,
&response2, callback_.callback()));
@@ -1405,17 +1346,12 @@ TEST_F(HttpPipelinedConnectionImplTest, EvictionDueToMissingContentLength) {
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK,
- ok_stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- evicted_stream->SendRequest(headers,
- scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
- EXPECT_EQ(OK,
- rejected_stream->SendRequest(headers,
- scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(OK, ok_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
+ EXPECT_EQ(OK, evicted_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
+ EXPECT_EQ(OK, rejected_stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
TestCompletionCallback ok_callback;
EXPECT_EQ(ERR_IO_PENDING,
@@ -1457,7 +1393,7 @@ TEST_F(HttpPipelinedConnectionImplTest, FeedbackOnSocketError) {
scoped_ptr<HttpStream> stream(NewTestStream("ok.html"));
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK, stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
+ EXPECT_EQ(OK, stream->SendRequest(headers, NULL,
&response, callback_.callback()));
EXPECT_EQ(ERR_FAILED, stream->ReadResponseHeaders(callback_.callback()));
}
@@ -1477,8 +1413,8 @@ TEST_F(HttpPipelinedConnectionImplTest, FeedbackOnNoInternetConnection) {
scoped_ptr<HttpStream> stream(NewTestStream("ok.html"));
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK, stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(OK, stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
EXPECT_EQ(ERR_INTERNET_DISCONNECTED,
stream->ReadResponseHeaders(callback_.callback()));
}
@@ -1580,8 +1516,8 @@ TEST_F(HttpPipelinedConnectionImplTest, OnPipelineHasCapacity) {
EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(1);
HttpRequestHeaders headers;
HttpResponseInfo response;
- EXPECT_EQ(OK, stream->SendRequest(headers, scoped_ptr<UploadDataStream>(),
- &response, callback_.callback()));
+ EXPECT_EQ(OK, stream->SendRequest(headers, NULL,
+ &response, callback_.callback()));
EXPECT_CALL(delegate_, OnPipelineHasCapacity(pipeline_.get())).Times(0);
MessageLoop::current()->RunAllPending();