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

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

Issue 1874613002: relnote: add connection option "SPSH" to indicate whether client wants to do server push or not, wh… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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_server_session_base.cc ('k') | net/tools/quic/quic_simple_server_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, _, _));
« no previous file with comments | « net/tools/quic/quic_server_session_base.cc ('k') | net/tools/quic/quic_simple_server_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698