diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-29 16:39:48 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-29 16:39:48 +0000 |
commit | bf2491a9366d2b72c0ebd3747e71c10f2504deaa (patch) | |
tree | d6e9c3a8e9b0f28a5a080a22da31fa0f819dcd6e /net/flip/flip_session_unittest.cc | |
parent | acf0a90181626aa23b7649c07e5be02b848d3e69 (diff) | |
download | chromium_src-bf2491a9366d2b72c0ebd3747e71c10f2504deaa.zip chromium_src-bf2491a9366d2b72c0ebd3747e71c10f2504deaa.tar.gz chromium_src-bf2491a9366d2b72c0ebd3747e71c10f2504deaa.tar.bz2 |
Reland: Fix the FlipSession to support partial writes.
Modified the FlipIOBuffer to use a DrainableIOBuffer instead
of a IOBufferWithSize. When a write completes, we drain the
bytes, and only fetch the next FlipFrame from the queue after
we have fully drained the buffer.
I will update the tests to be much more thorough in my next
CL.
BUG=none
TEST=FlipNetworkTransactionTest.PartialWrites
Review URL: http://codereview.chromium.org/451002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33250 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip/flip_session_unittest.cc')
-rw-r--r-- | net/flip/flip_session_unittest.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/flip/flip_session_unittest.cc b/net/flip/flip_session_unittest.cc index 20604fe..ca048ea 100644 --- a/net/flip/flip_session_unittest.cc +++ b/net/flip/flip_session_unittest.cc @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "net/base/test_completion_callback.h" #include "net/flip/flip_io_buffer.h" + +#include "net/base/test_completion_callback.h" #include "net/flip/flip_session.h" #include "net/flip/flip_stream.h" #include "net/socket/socket_test_util.h" @@ -22,7 +23,7 @@ TEST_F(FlipSessionTest, FlipIOBuffer) { // Insert 100 items; pri 100 to 1. for (size_t index = 0; index < kQueueSize; ++index) { - FlipIOBuffer buffer(NULL, kQueueSize - index, NULL); + FlipIOBuffer buffer(new IOBuffer(), 0, kQueueSize - index, NULL); queue_.push(buffer); } @@ -31,7 +32,7 @@ TEST_F(FlipSessionTest, FlipIOBuffer) { IOBufferWithSize* buffers[kNumDuplicates]; for (size_t index = 0; index < kNumDuplicates; ++index) { buffers[index] = new IOBufferWithSize(index+1); - queue_.push(FlipIOBuffer(buffers[index], 0, NULL)); + queue_.push(FlipIOBuffer(buffers[index], buffers[index]->size(), 0, NULL)); } EXPECT_EQ(kQueueSize + kNumDuplicates, queue_.size()); |