Index: net/tools/quic/quic_server_session_base_test.cc |
diff --git a/net/tools/quic/quic_server_session_base_test.cc b/net/tools/quic/quic_server_session_base_test.cc |
index 282804e81dde8e6897e1db13afde532e14235573..2e08f1443eb15711be71a71d2a7ca3207f4a84db 100644 |
--- a/net/tools/quic/quic_server_session_base_test.cc |
+++ b/net/tools/quic/quic_server_session_base_test.cc |
@@ -175,6 +175,16 @@ INSTANTIATE_TEST_CASE_P(Tests, |
QuicServerSessionBaseTest, |
::testing::ValuesIn(QuicSupportedVersions())); |
+TEST_P(QuicServerSessionBaseTest, ServerPushDisabledByDefault) { |
+ // Without the client explicitly sending kSPSH, server push will be disabled |
+ // at the server. |
+ EXPECT_FALSE( |
+ session_->config()->HasReceivedConnectionOptions() && |
+ ContainsQuicTag(session_->config()->ReceivedConnectionOptions(), kSPSH)); |
+ session_->OnConfigNegotiated(); |
+ EXPECT_FALSE(session_->server_push_enabled()); |
+} |
+ |
TEST_P(QuicServerSessionBaseTest, CloseStreamDueToReset) { |
// Open a stream, then reset it. |
// Send two bytes of payload to open it. |
@@ -324,6 +334,15 @@ TEST_P(QuicServerSessionBaseTest, MaxAvailableStreams) { |
session_.get(), kLimitingStreamId + 4)); |
} |
+TEST_P(QuicServerSessionBaseTest, EnableServerPushThroughConnectionOption) { |
+ // Assume server received server push connection option. |
+ QuicTagVector copt; |
+ copt.push_back(kSPSH); |
+ QuicConfigPeer::SetReceivedConnectionOptions(session_->config(), copt); |
+ session_->OnConfigNegotiated(); |
+ EXPECT_TRUE(session_->server_push_enabled()); |
+} |
+ |
TEST_P(QuicServerSessionBaseTest, GetEvenIncomingError) { |
// Incoming streams on the server session must be odd. |
EXPECT_CALL(*connection_, CloseConnection(QUIC_INVALID_STREAM_ID, _, _)); |