diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 00:17:13 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 00:17:13 +0000 |
commit | eebc0b413d66975e86be3814103438c3ec154bec (patch) | |
tree | d9e2ffbd86374f7fe8c778429e480c4cfea0a2dc /net/flip/flip_session_unittest.cc | |
parent | ad464a2dbe69ed57ea146e3b6a9eb9451ff161ae (diff) | |
download | chromium_src-eebc0b413d66975e86be3814103438c3ec154bec.zip chromium_src-eebc0b413d66975e86be3814103438c3ec154bec.tar.gz chromium_src-eebc0b413d66975e86be3814103438c3ec154bec.tar.bz2 |
Update the FLIP session to use the FlipIOBuffer.
Also removed some of the testing hacks for URL rewriting
that are no longer needed.
This change removes the 'batching' of frames written
to the socket. The reason for doing this is because
I'm going to need to start notifying to the upper layer
as progress is made on the writes (e.g. upload notifications).
When the frames are batched (potentially from different
transactions), it becomes very difficult to know when each
write completes. I don't think that batching is necessary,
as writes will accummulate in the socket buffer, so this
should be a better approach.
BUG=none
TEST=flip_session_unittest.cc
Review URL: http://codereview.chromium.org/342088
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30898 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip/flip_session_unittest.cc')
-rw-r--r-- | net/flip/flip_session_unittest.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/flip/flip_session_unittest.cc b/net/flip/flip_session_unittest.cc index 90bf938..c27f478 100644 --- a/net/flip/flip_session_unittest.cc +++ b/net/flip/flip_session_unittest.cc @@ -3,25 +3,25 @@ // found in the LICENSE file. #include "net/base/test_completion_callback.h" +#include "net/flip/flip_io_buffer.h" +#include "net/flip/flip_session.h" #include "net/socket/socket_test_util.h" #include "testing/platform_test.h" -#include "net/flip/flip_session.h" - namespace net { class FlipSessionTest : public PlatformTest { public: }; -// Test the PrioritizedIOBuffer class. -TEST_F(FlipSessionTest, PrioritizedIOBuffer) { - std::priority_queue<PrioritizedIOBuffer> queue_; +// Test the FlipIOBuffer class. +TEST_F(FlipSessionTest, FlipIOBuffer) { + std::priority_queue<FlipIOBuffer> queue_; const size_t kQueueSize = 100; // Insert 100 items; pri 100 to 1. for (size_t index = 0; index < kQueueSize; ++index) { - PrioritizedIOBuffer buffer(NULL, kQueueSize - index); + FlipIOBuffer buffer(NULL, kQueueSize - index, NULL); queue_.push(buffer); } @@ -30,14 +30,14 @@ TEST_F(FlipSessionTest, PrioritizedIOBuffer) { IOBufferWithSize* buffers[kNumDuplicates]; for (size_t index = 0; index < kNumDuplicates; ++index) { buffers[index] = new IOBufferWithSize(index+1); - queue_.push(PrioritizedIOBuffer(buffers[index], 0)); + queue_.push(FlipIOBuffer(buffers[index], 0, NULL)); } EXPECT_EQ(kQueueSize + kNumDuplicates, queue_.size()); // Verify the P0 items come out in FIFO order. for (size_t index = 0; index < kNumDuplicates; ++index) { - PrioritizedIOBuffer buffer = queue_.top(); + FlipIOBuffer buffer = queue_.top(); EXPECT_EQ(0, buffer.priority()); EXPECT_EQ(index + 1, buffer.size()); queue_.pop(); @@ -45,7 +45,7 @@ TEST_F(FlipSessionTest, PrioritizedIOBuffer) { int priority = 1; while (queue_.size()) { - PrioritizedIOBuffer buffer = queue_.top(); + FlipIOBuffer buffer = queue_.top(); EXPECT_EQ(priority++, buffer.priority()); queue_.pop(); } |