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

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

Issue 2104633002: Landing recent QUIC changes until 6/24/2016 14:00 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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/end_to_end_test.cc ('k') | net/tools/quic/quic_simple_server_session_test.cc » ('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 8e788861f54d4adce9c7b5113893d4721a1b201a..a38214c8b283073b80d804704c78f9044777b309 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -13,6 +13,7 @@
#include "net/quic/spdy_utils.h"
#include "net/quic/test_tools/crypto_test_utils.h"
#include "net/quic/test_tools/mock_quic_spdy_client_stream.h"
+#include "net/quic/test_tools/quic_config_peer.h"
#include "net/quic/test_tools/quic_connection_peer.h"
#include "net/quic/test_tools/quic_packet_creator_peer.h"
#include "net/quic/test_tools/quic_spdy_session_peer.h"
@@ -112,11 +113,17 @@ class QuicClientSessionTest : public ::testing::TestWithParam<QuicVersion> {
}
void CompleteCryptoHandshake() {
+ CompleteCryptoHandshake(kDefaultMaxStreamsPerConnection);
+ }
+
+ void CompleteCryptoHandshake(uint32_t server_max_incoming_streams) {
session_->CryptoConnect();
QuicCryptoClientStream* stream =
static_cast<QuicCryptoClientStream*>(session_->GetCryptoStream());
CryptoTestUtils::FakeServerOptions options;
- CryptoTestUtils::HandshakeWithFakeServer(&helper_, &alarm_factory_,
+ QuicConfig config = DefaultQuicConfig();
+ config.SetMaxIncomingDynamicStreamsToSend(server_max_incoming_streams);
+ CryptoTestUtils::HandshakeWithFakeServer(&config, &helper_, &alarm_factory_,
connection_, stream, options);
}
@@ -183,10 +190,15 @@ TEST_P(QuicClientSessionTest, NoEncryptionAfterInitialEncryption) {
TEST_P(QuicClientSessionTest, MaxNumStreamsWithNoFinOrRst) {
EXPECT_CALL(*connection_, SendRstStream(_, _, _)).Times(AnyNumber());
- session_->config()->SetMaxStreamsPerConnection(1, 1);
+ if (GetParam() <= QUIC_VERSION_34) {
+ session_->config()->SetMaxStreamsPerConnection(1, 1);
- // Initialize crypto before the client session will create a stream.
- CompleteCryptoHandshake();
+ // Initialize crypto before the client session will create a stream.
+ CompleteCryptoHandshake();
+ } else {
+ const uint32_t kServerMaxIncomingStreams = 1;
+ CompleteCryptoHandshake(kServerMaxIncomingStreams);
+ }
QuicSpdyClientStream* stream =
session_->CreateOutgoingDynamicStream(kDefaultPriority);
@@ -205,10 +217,15 @@ TEST_P(QuicClientSessionTest, MaxNumStreamsWithNoFinOrRst) {
TEST_P(QuicClientSessionTest, MaxNumStreamsWithRst) {
EXPECT_CALL(*connection_, SendRstStream(_, _, _)).Times(AnyNumber());
- session_->config()->SetMaxStreamsPerConnection(1, 1);
+ if (GetParam() <= QUIC_VERSION_34) {
+ session_->config()->SetMaxStreamsPerConnection(1, 1);
- // Initialize crypto before the client session will create a stream.
- CompleteCryptoHandshake();
+ // Initialize crypto before the client session will create a stream.
+ CompleteCryptoHandshake();
+ } else {
+ const uint32_t kServerMaxIncomingStreams = 1;
+ CompleteCryptoHandshake(kServerMaxIncomingStreams);
+ }
QuicSpdyClientStream* stream =
session_->CreateOutgoingDynamicStream(kDefaultPriority);
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_simple_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698