| Index: net/tools/quic/end_to_end_test.cc
|
| diff --git a/net/tools/quic/end_to_end_test.cc b/net/tools/quic/end_to_end_test.cc
|
| index 3843bb923918569d51c696f8d6437936f28299e0..7c1f82f773d5af3d43cb9035042a51b5d2f97796 100644
|
| --- a/net/tools/quic/end_to_end_test.cc
|
| +++ b/net/tools/quic/end_to_end_test.cc
|
| @@ -373,6 +373,7 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
|
| bool Initialize() {
|
| QuicTagVector copt;
|
| server_config_.SetConnectionOptionsToSend(copt);
|
| + copt = client_extra_copts_;
|
|
|
| // TODO(nimia): Consider setting the congestion control algorithm for the
|
| // client as well according to the test parameter.
|
| @@ -574,6 +575,7 @@ class EndToEndTest : public ::testing::TestWithParam<TestParams> {
|
| QuicConfig server_config_;
|
| QuicVersionVector client_supported_versions_;
|
| QuicVersionVector server_supported_versions_;
|
| + QuicTagVector client_extra_copts_;
|
| QuicVersion negotiated_version_;
|
| size_t chlo_multiplier_;
|
| QuicTestServer::StreamFactory* stream_factory_;
|
| @@ -1707,6 +1709,53 @@ TEST_P(EndToEndTest, DifferentFlowControlWindows) {
|
| server_thread_->Resume();
|
| }
|
|
|
| +// Test negotiation of IFWA connection option.
|
| +TEST_P(EndToEndTest, NegotiatedServerInitialFlowControlWindow) {
|
| + FLAGS_quic_large_ifw_options = true;
|
| +
|
| + const uint32_t kClientStreamIFCW = 123456;
|
| + const uint32_t kClientSessionIFCW = 234567;
|
| + set_client_initial_stream_flow_control_receive_window(kClientStreamIFCW);
|
| + set_client_initial_session_flow_control_receive_window(kClientSessionIFCW);
|
| +
|
| + uint32_t kServerStreamIFCW = 32 * 1024;
|
| + uint32_t kServerSessionIFCW = 48 * 1024;
|
| + set_server_initial_stream_flow_control_receive_window(kServerStreamIFCW);
|
| + set_server_initial_session_flow_control_receive_window(kServerSessionIFCW);
|
| +
|
| + // Bump the window.
|
| + const uint32_t kExpectedStreamIFCW = 1024 * 1024;
|
| + const uint32_t kExpectedSessionIFCW = 1.5 * 1024 * 1024;
|
| + client_extra_copts_.push_back(kIFWA);
|
| +
|
| + ASSERT_TRUE(Initialize());
|
| +
|
| + // Values are exchanged during crypto handshake, so wait for that to finish.
|
| + EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed());
|
| + server_thread_->WaitForCryptoHandshakeConfirmed();
|
| +
|
| + // Open a data stream to make sure the stream level flow control is updated.
|
| + QuicSpdyClientStream* stream = client_->GetOrCreateStream();
|
| + stream->WriteOrBufferBody("hello", false, nullptr);
|
| +
|
| + // Client should have the right values for server's receive window.
|
| + EXPECT_EQ(kExpectedStreamIFCW,
|
| + client_->client()
|
| + ->session()
|
| + ->config()
|
| + ->ReceivedInitialStreamFlowControlWindowBytes());
|
| + EXPECT_EQ(kExpectedSessionIFCW,
|
| + client_->client()
|
| + ->session()
|
| + ->config()
|
| + ->ReceivedInitialSessionFlowControlWindowBytes());
|
| + EXPECT_EQ(kExpectedStreamIFCW, QuicFlowControllerPeer::SendWindowOffset(
|
| + stream->flow_controller()));
|
| + EXPECT_EQ(kExpectedSessionIFCW,
|
| + QuicFlowControllerPeer::SendWindowOffset(
|
| + client_->client()->session()->flow_controller()));
|
| +}
|
| +
|
| TEST_P(EndToEndTest, HeadersAndCryptoStreamsNoConnectionFlowControl) {
|
| // The special headers and crypto streams should be subject to per-stream flow
|
| // control limits, but should not be subject to connection level flow control
|
| @@ -2480,8 +2529,9 @@ TEST_P(EndToEndTest, EarlyResponseFinRecording) {
|
|
|
| // The stream is not waiting for the arrival of the peer's final offset.
|
| EXPECT_EQ(
|
| - 0u, QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(server_session)
|
| - .size());
|
| + 0u,
|
| + QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(server_session)
|
| + .size());
|
|
|
| server_thread_->Resume();
|
| }
|
| @@ -2628,8 +2678,9 @@ TEST_P(EndToEndTestServerPush, ServerPush) {
|
| new TestResponseListener));
|
|
|
| DVLOG(1) << "send request for /push_example";
|
| - EXPECT_EQ(kBody, client_->SendSynchronousRequest(
|
| - "https://example.com/push_example"));
|
| + EXPECT_EQ(
|
| + kBody,
|
| + client_->SendSynchronousRequest("https://example.com/push_example"));
|
| QuicHeadersStream* headers_stream =
|
| QuicSpdySessionPeer::GetHeadersStream(client_->client()->session());
|
| QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(headers_stream);
|
| @@ -2679,8 +2730,9 @@ TEST_P(EndToEndTestServerPush, ServerPushUnderLimit) {
|
| // Send the first request: this will trigger the server to send all the push
|
| // resources associated with this request, and these will be cached by the
|
| // client.
|
| - EXPECT_EQ(kBody, client_->SendSynchronousRequest(
|
| - "https://example.com/push_example"));
|
| + EXPECT_EQ(
|
| + kBody,
|
| + client_->SendSynchronousRequest("https://example.com/push_example"));
|
|
|
| for (const string& url : push_urls) {
|
| // Sending subsequent requesets will not actually send anything on the wire,
|
| @@ -2727,8 +2779,9 @@ TEST_P(EndToEndTestServerPush, ServerPushOverLimitNonBlocking) {
|
| // Send the first request: this will trigger the server to send all the push
|
| // resources associated with this request, and these will be cached by the
|
| // client.
|
| - EXPECT_EQ(kBody, client_->SendSynchronousRequest(
|
| - "https://example.com/push_example"));
|
| + EXPECT_EQ(
|
| + kBody,
|
| + client_->SendSynchronousRequest("https://example.com/push_example"));
|
|
|
| for (const string& url : push_urls) {
|
| // Sending subsequent requesets will not actually send anything on the wire,
|
| @@ -2847,8 +2900,9 @@ TEST_P(EndToEndTestServerPush, DisabledWithoutConnectionOption) {
|
| client_->client()->set_response_listener(
|
| std::unique_ptr<QuicClientBase::ResponseListener>(
|
| new TestResponseListener));
|
| - EXPECT_EQ(kBody, client_->SendSynchronousRequest(
|
| - "https://example.com/push_example"));
|
| + EXPECT_EQ(
|
| + kBody,
|
| + client_->SendSynchronousRequest("https://example.com/push_example"));
|
|
|
| for (const string& url : push_urls) {
|
| // Sending subsequent requests will trigger sending real requests because
|
|
|