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

Unified Diff: net/quic/reliable_quic_stream_test.cc

Issue 242453002: Pull out flow control functionality from ReliableQuicStream into a new (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/quic/reliable_quic_stream.cc ('k') | net/quic/test_tools/quic_flow_controller_peer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/reliable_quic_stream_test.cc
diff --git a/net/quic/reliable_quic_stream_test.cc b/net/quic/reliable_quic_stream_test.cc
index 801800b821b4c4075e4fb9251d7b1fd4e576945a..8ee03b58126e6687aba5da83bb751c7109f18f56 100644
--- a/net/quic/reliable_quic_stream_test.cc
+++ b/net/quic/reliable_quic_stream_test.cc
@@ -10,6 +10,7 @@
#include "net/quic/quic_utils.h"
#include "net/quic/quic_write_blocked_list.h"
#include "net/quic/spdy_utils.h"
+#include "net/quic/test_tools/quic_flow_controller_peer.h"
#include "net/quic/test_tools/quic_session_peer.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "net/quic/test_tools/reliable_quic_stream_peer.h"
@@ -58,10 +59,6 @@ class TestStream : public ReliableQuicStream {
return QuicUtils::HighestPriority();
}
- virtual bool IsFlowControlEnabled() const OVERRIDE {
- return true;
- }
-
using ReliableQuicStream::WriteOrBufferData;
using ReliableQuicStream::CloseReadSide;
using ReliableQuicStream::CloseWriteSide;
@@ -321,13 +318,15 @@ TEST_F(ReliableQuicStreamTest, StreamFlowControlMultipleWindowUpdates) {
// Initially should be default.
EXPECT_EQ(initial_flow_control_window_bytes_,
- ReliableQuicStreamPeer::SendWindowOffset(stream_.get()));
+ QuicFlowControllerPeer::SendWindowOffset(
+ stream_.get()->flow_controller()));
// Check a single WINDOW_UPDATE results in correct offset.
QuicWindowUpdateFrame window_update_1(stream_->id(), 1234);
stream_->OnWindowUpdateFrame(window_update_1);
EXPECT_EQ(window_update_1.byte_offset,
- ReliableQuicStreamPeer::SendWindowOffset(stream_.get()));
+ QuicFlowControllerPeer::SendWindowOffset(
+ stream_.get()->flow_controller()));
// Now send a few more WINDOW_UPDATES and make sure that only the largest is
// remembered.
@@ -338,7 +337,8 @@ TEST_F(ReliableQuicStreamTest, StreamFlowControlMultipleWindowUpdates) {
stream_->OnWindowUpdateFrame(window_update_3);
stream_->OnWindowUpdateFrame(window_update_4);
EXPECT_EQ(window_update_3.byte_offset,
- ReliableQuicStreamPeer::SendWindowOffset(stream_.get()));
+ QuicFlowControllerPeer::SendWindowOffset(
+ stream_.get()->flow_controller()));
}
void SaveProxyAckNotifierDelegate(
@@ -359,6 +359,9 @@ TEST_F(ReliableQuicStreamTest, WriteOrBufferDataWithQuicAckNotifier) {
const int kSecondWriteSize = 50;
const int kLastWriteSize = kDataSize - kFirstWriteSize - kSecondWriteSize;
+ // Set a large flow control send window so this doesn't interfere with test.
+ stream_->flow_controller()->UpdateSendWindowOffset(kDataSize + 1);
+
scoped_refptr<QuicAckNotifier::DelegateInterface> proxy_delegate;
EXPECT_CALL(*session_, WritevData(kStreamId, _, _, _, _)).WillOnce(DoAll(
@@ -408,6 +411,9 @@ TEST_F(ReliableQuicStreamTest, WriteOrBufferDataAckNotificationBeforeFlush) {
const int kInitialWriteSize = 100;
+ // Set a large flow control send window so this doesn't interfere with test.
+ stream_->flow_controller()->UpdateSendWindowOffset(kDataSize + 1);
+
scoped_refptr<QuicAckNotifier::DelegateInterface> proxy_delegate;
EXPECT_CALL(*session_, WritevData(kStreamId, _, _, _, _)).WillOnce(DoAll(
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | net/quic/test_tools/quic_flow_controller_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698