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

Unified Diff: net/tools/quic/quic_client_session_test.cc

Issue 15074007: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for windows Created 7 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/tools/quic/quic_client_session.cc ('k') | net/tools/quic/quic_epoll_connection_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_client_session_test.cc
diff --git a/net/tools/quic/quic_client_session_test.cc b/net/tools/quic/quic_client_session_test.cc
index 39543db740b5cacc4220f60df5a60af634d57c9c..0b9603c507e5027bd24da5d31e9428dd4cf99661 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -27,22 +27,23 @@ class QuicClientSessionTest : public ::testing::Test {
protected:
QuicClientSessionTest()
: guid_(1),
- connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)),
- session_(kServerHostname, config_, connection_, &crypto_config_) {
- config_.SetDefaults();
+ connection_(new PacketSavingConnection(guid_, IPEndPoint(), false)) {
crypto_config_.SetDefaults();
+ session_.reset(new QuicClientSession(kServerHostname, QuicConfig(),
+ connection_, &crypto_config_));
+ session_->config()->SetDefaults();
+ session_->config()->set_max_streams_per_connection(1, 1);
}
void CompleteCryptoHandshake() {
- ASSERT_TRUE(session_.CryptoConnect());
+ ASSERT_TRUE(session_->CryptoConnect());
CryptoTestUtils::HandshakeWithFakeServer(
- connection_, session_.GetCryptoStream());
+ connection_, session_->GetCryptoStream());
}
QuicGuid guid_;
PacketSavingConnection* connection_;
- QuicClientSession session_;
- QuicConfig config_;
+ scoped_ptr<QuicClientSession> session_;
QuicCryptoClientConfig crypto_config_;
};
@@ -56,28 +57,28 @@ TEST_F(QuicClientSessionTest, DISABLED_MaxNumConnections) {
CompleteCryptoHandshake();
QuicReliableClientStream* stream =
- session_.CreateOutgoingReliableStream();
+ session_->CreateOutgoingReliableStream();
ASSERT_TRUE(stream);
- EXPECT_FALSE(session_.CreateOutgoingReliableStream());
+ EXPECT_FALSE(session_->CreateOutgoingReliableStream());
// Close a stream and ensure I can now open a new one.
- session_.CloseStream(stream->id());
- stream = session_.CreateOutgoingReliableStream();
+ session_->CloseStream(stream->id());
+ stream = session_->CreateOutgoingReliableStream();
EXPECT_TRUE(stream);
}
TEST_F(QuicClientSessionTest, GoAwayReceived) {
// Initialize crypto before the client session will create a stream.
- ASSERT_TRUE(session_.CryptoConnect());
+ ASSERT_TRUE(session_->CryptoConnect());
// Simulate the server crypto handshake.
CryptoHandshakeMessage server_message;
server_message.set_tag(kSHLO);
- session_.GetCryptoStream()->OnHandshakeMessage(server_message);
+ session_->GetCryptoStream()->OnHandshakeMessage(server_message);
// After receiving a GoAway, I should no longer be able to create outgoing
// streams.
- session_.OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away."));
- EXPECT_EQ(NULL, session_.CreateOutgoingReliableStream());
+ session_->OnGoAway(QuicGoAwayFrame(QUIC_PEER_GOING_AWAY, 1u, "Going away."));
+ EXPECT_EQ(NULL, session_->CreateOutgoingReliableStream());
}
} // namespace
« no previous file with comments | « net/tools/quic/quic_client_session.cc ('k') | net/tools/quic/quic_epoll_connection_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698