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

Unified Diff: net/quic/quic_session_test.cc

Issue 286213002: Refactor: move flow controller from QuicConnection to QuicSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Created 6 years, 7 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/quic_session.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_session_test.cc
diff --git a/net/quic/quic_session_test.cc b/net/quic/quic_session_test.cc
index b2dfa0e5878e97d90561337bac708ff9a2f27fb4..a8cbc723811bc69003b78f918156056bfefe4502 100644
--- a/net/quic/quic_session_test.cc
+++ b/net/quic/quic_session_test.cc
@@ -104,11 +104,12 @@ class StreamBlocker {
class TestSession : public QuicSession {
public:
- explicit TestSession(QuicConnection* connection)
- : QuicSession(connection, DefaultQuicConfig()),
+ explicit TestSession(QuicConnection* connection,
+ uint32 max_initial_flow_control_window)
+ : QuicSession(connection, max_initial_flow_control_window,
+ DefaultQuicConfig()),
crypto_stream_(this),
- writev_consumes_all_data_(false) {
- }
+ writev_consumes_all_data_(false) {}
virtual TestCryptoStream* GetCryptoStream() OVERRIDE {
return &crypto_stream_;
@@ -165,7 +166,7 @@ class QuicSessionTest : public ::testing::TestWithParam<QuicVersion> {
protected:
QuicSessionTest()
: connection_(new MockConnection(true, SupportedVersions(GetParam()))),
- session_(connection_) {
+ session_(connection_, kInitialFlowControlWindowForTest) {
headers_[":host"] = "www.google.com";
headers_[":path"] = "/index.hml";
headers_[":scheme"] = "http";
@@ -617,6 +618,17 @@ TEST_P(QuicSessionTest, InvalidFlowControlWindowInHandshake) {
session_.OnConfigNegotiated();
}
+TEST_P(QuicSessionTest, InvalidFlowControlWindow) {
+ QuicConnection* connection =
+ new MockConnection(true, SupportedVersions(GetParam()));
+
+ const uint32 kSmallerFlowControlWindow = kDefaultFlowControlSendWindow - 1;
+ TestSession session(connection, kSmallerFlowControlWindow);
+
+ EXPECT_EQ(kDefaultFlowControlSendWindow,
+ session.max_flow_control_receive_window_bytes());
+}
+
} // namespace
} // namespace test
} // namespace net
« no previous file with comments | « net/quic/quic_session.cc ('k') | net/quic/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698