| 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)};
|
|
|