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

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

Issue 2862563003: Landing Recent QUIC changes until Sat Apr 29 00:22:04 2017 +0000 (Closed)
Patch Set: rebase and fix test bugs detected by swarm bot. Created 3 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_dispatcher_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 7afd5389c7e1b6d7868f31f0d914380fc499d75b..b4b09e7e4ca96109926675d87322e3b6d824067e 100644
--- a/net/tools/quic/quic_client_session_test.cc
+++ b/net/tools/quic/quic_client_session_test.cc
@@ -54,20 +54,31 @@ class TestQuicClientSession : public QuicClientSession {
this);
}
+ std::unique_ptr<QuicStream> CreateStream(QuicStreamId id) override {
+ return QuicMakeUnique<MockQuicSpdyClientStream>(id, this);
+ }
+
MockQuicSpdyClientStream* CreateIncomingDynamicStream(
QuicStreamId id) override {
MockQuicSpdyClientStream* stream = new MockQuicSpdyClientStream(id, this);
ActivateStream(QuicWrapUnique(stream));
return stream;
}
+
+ QuicSpdyClientStream* CreateOutgoingDynamicStream(
+ SpdyPriority priority) override {
+ return FLAGS_quic_reloadable_flag_quic_refactor_stream_creation
+ ? MaybeCreateOutgoingDynamicStream(priority)
+ : QuicClientSession::CreateOutgoingDynamicStream(priority);
+ }
};
class QuicClientSessionTest : public QuicTestWithParam<QuicVersion> {
protected:
QuicClientSessionTest()
: crypto_config_(crypto_test_utils::ProofVerifierForTesting()),
- promised_stream_id_(kServerDataStreamId1),
- associated_stream_id_(kClientDataStreamId1) {
+ promised_stream_id_(kInvalidStreamId),
+ associated_stream_id_(kInvalidStreamId) {
Initialize();
// Advance the time, because timers do not like uninitialized times.
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
@@ -94,6 +105,10 @@ class QuicClientSessionTest : public QuicTestWithParam<QuicVersion> {
push_promise_[":method"] = "GET";
push_promise_[":scheme"] = "https";
promise_url_ = SpdyUtils::GetUrlFromHeaderBlock(push_promise_);
+ promised_stream_id_ =
+ QuicSpdySessionPeer::GetNthServerInitiatedStreamId(*session_, 0);
+ associated_stream_id_ =
+ QuicSpdySessionPeer::GetNthClientInitiatedStreamId(*session_, 0);
}
void CompleteCryptoHandshake() {
@@ -159,8 +174,12 @@ TEST_P(QuicClientSessionTest, NoEncryptionAfterInitialEncryption) {
QuicPacketCreatorPeer::GetEncryptionLevel(
QuicConnectionPeer::GetPacketCreator(connection_)));
// Verify that no new streams may be created.
- EXPECT_TRUE(session_->CreateOutgoingDynamicStream(kDefaultPriority) ==
- nullptr);
+ if (FLAGS_quic_reloadable_flag_quic_refactor_stream_creation) {
+ EXPECT_EQ(nullptr, session_->CreateOutgoingDynamicStream(kDefaultPriority));
+ } else {
+ EXPECT_TRUE(session_->CreateOutgoingDynamicStream(kDefaultPriority) ==
+ nullptr);
+ }
// Verify that no data may be send on existing streams.
char data[] = "hello world";
struct iovec iov = {data, arraysize(data)};
« no previous file with comments | « net/tools/quic/quic_client_session.cc ('k') | net/tools/quic/quic_dispatcher_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698