summaryrefslogtreecommitdiffstats
path: root/net/spdy
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 07:39:11 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-10 07:39:11 +0000
commit1dce708bbe7fdef15436e20f36f805f53bfdcb73 (patch)
tree3b7852c44e541e6d755fb1044c857d37bc622252 /net/spdy
parent9caded3f4f06300155f117134f59b5d85b98119f (diff)
downloadchromium_src-1dce708bbe7fdef15436e20f36f805f53bfdcb73.zip
chromium_src-1dce708bbe7fdef15436e20f36f805f53bfdcb73.tar.gz
chromium_src-1dce708bbe7fdef15436e20f36f805f53bfdcb73.tar.bz2
net: Make UploadData::GetContentLength() asynchronous.
However, the asynchronous version is not used yet. The synchronous version is kept as GetContentLengthSync(). The existing code is changed to use the synchronous version. TEST=net_unittests BUG=72001,112607 Review URL: https://chromiumcodereview.appspot.com/9321003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121411 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy')
-rw-r--r--net/spdy/spdy_network_transaction_unittest.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index 6d4c496d..97e494d 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -1689,14 +1689,16 @@ TEST_P(SpdyNetworkTransactionTest, EmptyPost) {
request.upload_data = new UploadData();
// Http POST Content-Length is using UploadDataStream::size().
- // It is the same as request.upload_data->GetContentLength().
+ // It is the same as request.upload_data->GetContentLengthSync().
scoped_ptr<UploadDataStream> stream(
new UploadDataStream(request.upload_data));
ASSERT_EQ(OK, stream->Init());
- ASSERT_EQ(request.upload_data->GetContentLength(), stream->size());
+ ASSERT_EQ(request.upload_data->GetContentLengthSync(),
+ stream->size());
scoped_ptr<spdy::SpdyFrame>
- req(ConstructSpdyPost(request.upload_data->GetContentLength(), NULL, 0));
+ req(ConstructSpdyPost(
+ request.upload_data->GetContentLengthSync(), NULL, 0));
// Set the FIN bit since there will be no body.
req->set_flags(spdy::CONTROL_FLAG_FIN);
MockWrite writes[] = {
@@ -1736,11 +1738,12 @@ TEST_P(SpdyNetworkTransactionTest, PostWithEarlySynReply) {
request.upload_data->AppendBytes(upload, sizeof(upload));
// Http POST Content-Length is using UploadDataStream::size().
- // It is the same as request.upload_data->GetContentLength().
+ // It is the same as request.upload_data->GetContentLengthSync().
scoped_ptr<UploadDataStream> stream(
new UploadDataStream(request.upload_data));
ASSERT_EQ(OK, stream->Init());
- ASSERT_EQ(request.upload_data->GetContentLength(), stream->size());
+ ASSERT_EQ(request.upload_data->GetContentLengthSync(),
+ stream->size());
scoped_ptr<spdy::SpdyFrame> stream_reply(ConstructSpdyPostSynReply(NULL, 0));
scoped_ptr<spdy::SpdyFrame> stream_body(ConstructSpdyBodyFrame(1, true));
MockRead reads[] = {