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

Side by Side Diff: net/tools/quic/end_to_end_test.cc

Issue 2479083002: Deprecate FLAGS_quic_reduce_sequencer_buffer_memory_life_time. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « net/quic/test_tools/quic_stream_sequencer_buffer_peer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <sys/epoll.h> 6 #include <sys/epoll.h>
7 7
8 #include <cstdint> 8 #include <cstdint>
9 #include <list> 9 #include <list>
10 #include <memory> 10 #include <memory>
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 EndToEndTest, 612 EndToEndTest,
613 ::testing::ValuesIn(GetTestParams())); 613 ::testing::ValuesIn(GetTestParams()));
614 614
615 TEST_P(EndToEndTest, HandshakeSuccessful) { 615 TEST_P(EndToEndTest, HandshakeSuccessful) {
616 ASSERT_TRUE(Initialize()); 616 ASSERT_TRUE(Initialize());
617 client_->client()->WaitForCryptoHandshakeConfirmed(); 617 client_->client()->WaitForCryptoHandshakeConfirmed();
618 QuicCryptoStream* crypto_stream = 618 QuicCryptoStream* crypto_stream =
619 QuicSessionPeer::GetCryptoStream(client_->client()->session()); 619 QuicSessionPeer::GetCryptoStream(client_->client()->session());
620 QuicStreamSequencer* sequencer = 620 QuicStreamSequencer* sequencer =
621 ReliableQuicStreamPeer::sequencer(crypto_stream); 621 ReliableQuicStreamPeer::sequencer(crypto_stream);
622 EXPECT_NE(FLAGS_quic_release_crypto_stream_buffer && 622 EXPECT_NE(FLAGS_quic_release_crypto_stream_buffer,
623 FLAGS_quic_reduce_sequencer_buffer_memory_life_time,
624 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); 623 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer));
625 server_thread_->Pause(); 624 server_thread_->Pause();
626 QuicDispatcher* dispatcher = 625 QuicDispatcher* dispatcher =
627 QuicServerPeer::GetDispatcher(server_thread_->server()); 626 QuicServerPeer::GetDispatcher(server_thread_->server());
628 QuicSession* server_session = dispatcher->session_map().begin()->second.get(); 627 QuicSession* server_session = dispatcher->session_map().begin()->second.get();
629 crypto_stream = QuicSessionPeer::GetCryptoStream(server_session); 628 crypto_stream = QuicSessionPeer::GetCryptoStream(server_session);
630 sequencer = ReliableQuicStreamPeer::sequencer(crypto_stream); 629 sequencer = ReliableQuicStreamPeer::sequencer(crypto_stream);
631 EXPECT_NE(FLAGS_quic_release_crypto_stream_buffer && 630 EXPECT_NE(FLAGS_quic_release_crypto_stream_buffer,
632 FLAGS_quic_reduce_sequencer_buffer_memory_life_time,
633 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); 631 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer));
634 } 632 }
635 633
636 TEST_P(EndToEndTest, SimpleRequestResponse) { 634 TEST_P(EndToEndTest, SimpleRequestResponse) {
637 ASSERT_TRUE(Initialize()); 635 ASSERT_TRUE(Initialize());
638 636
639 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); 637 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo"));
640 EXPECT_EQ("200", client_->response_headers()->find(":status")->second); 638 EXPECT_EQ("200", client_->response_headers()->find(":status")->second);
641 EXPECT_EQ(2, client_->client()->GetNumSentClientHellos()); 639 EXPECT_EQ(2, client_->client()->GetNumSentClientHellos());
642 } 640 }
(...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after
2649 // hasn't finished yet. 2647 // hasn't finished yet.
2650 EXPECT_TRUE(QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); 2648 EXPECT_TRUE(QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer));
2651 2649
2652 for (const string& url : push_urls) { 2650 for (const string& url : push_urls) {
2653 DVLOG(1) << "send request for pushed stream on url " << url; 2651 DVLOG(1) << "send request for pushed stream on url " << url;
2654 string expected_body = "This is server push response body for " + url; 2652 string expected_body = "This is server push response body for " + url;
2655 string response_body = client_->SendSynchronousRequest(url); 2653 string response_body = client_->SendSynchronousRequest(url);
2656 DVLOG(1) << "response body " << response_body; 2654 DVLOG(1) << "response body " << response_body;
2657 EXPECT_EQ(expected_body, response_body); 2655 EXPECT_EQ(expected_body, response_body);
2658 } 2656 }
2659 EXPECT_NE(FLAGS_quic_headers_stream_release_sequencer_buffer && 2657 EXPECT_NE(FLAGS_quic_headers_stream_release_sequencer_buffer,
2660 FLAGS_quic_reduce_sequencer_buffer_memory_life_time,
2661 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); 2658 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer));
2662 } 2659 }
2663 2660
2664 TEST_P(EndToEndTestServerPush, ServerPushUnderLimit) { 2661 TEST_P(EndToEndTestServerPush, ServerPushUnderLimit) {
2665 // Tests that sending a request which has 4 push resources will trigger server 2662 // Tests that sending a request which has 4 push resources will trigger server
2666 // to push those 4 resources and client can handle pushed resources and match 2663 // to push those 4 resources and client can handle pushed resources and match
2667 // them with requests later. 2664 // them with requests later.
2668 ASSERT_TRUE(Initialize()); 2665 ASSERT_TRUE(Initialize());
2669 2666
2670 client_->client()->WaitForCryptoHandshakeConfirmed(); 2667 client_->client()->WaitForCryptoHandshakeConfirmed();
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
2955 2952
2956 TEST_P(EndToEndTest, ReleaseHeadersStreamBufferWhenIdle) { 2953 TEST_P(EndToEndTest, ReleaseHeadersStreamBufferWhenIdle) {
2957 // Tests that when client side has no active request and no waiting 2954 // Tests that when client side has no active request and no waiting
2958 // PUSH_PROMISE, its headers stream's sequencer buffer should be released. 2955 // PUSH_PROMISE, its headers stream's sequencer buffer should be released.
2959 ASSERT_TRUE(Initialize()); 2956 ASSERT_TRUE(Initialize());
2960 client_->SendSynchronousRequest("/foo"); 2957 client_->SendSynchronousRequest("/foo");
2961 QuicHeadersStream* headers_stream = 2958 QuicHeadersStream* headers_stream =
2962 QuicSpdySessionPeer::GetHeadersStream(client_->client()->session()); 2959 QuicSpdySessionPeer::GetHeadersStream(client_->client()->session());
2963 QuicStreamSequencer* sequencer = 2960 QuicStreamSequencer* sequencer =
2964 ReliableQuicStreamPeer::sequencer(headers_stream); 2961 ReliableQuicStreamPeer::sequencer(headers_stream);
2965 EXPECT_NE(FLAGS_quic_headers_stream_release_sequencer_buffer && 2962 EXPECT_NE(FLAGS_quic_headers_stream_release_sequencer_buffer,
2966 FLAGS_quic_reduce_sequencer_buffer_memory_life_time,
2967 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); 2963 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer));
2968 } 2964 }
2969 2965
2970 class EndToEndBufferedPacketsTest : public EndToEndTest { 2966 class EndToEndBufferedPacketsTest : public EndToEndTest {
2971 public: 2967 public:
2972 EndToEndBufferedPacketsTest() : EndToEndTest() { 2968 EndToEndBufferedPacketsTest() : EndToEndTest() {
2973 FLAGS_quic_buffer_packet_till_chlo = true; 2969 FLAGS_quic_buffer_packet_till_chlo = true;
2974 } 2970 }
2975 2971
2976 void CreateClientWithWriter() override { 2972 void CreateClientWithWriter() override {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3023 client_->WaitForResponse(); 3019 client_->WaitForResponse();
3024 EXPECT_EQ(kBarResponseBody, client_->response_body()); 3020 EXPECT_EQ(kBarResponseBody, client_->response_body());
3025 QuicConnectionStats client_stats = 3021 QuicConnectionStats client_stats =
3026 client_->client()->session()->connection()->GetStats(); 3022 client_->client()->session()->connection()->GetStats();
3027 EXPECT_EQ(0u, client_stats.packets_lost); 3023 EXPECT_EQ(0u, client_stats.packets_lost);
3028 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); 3024 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos());
3029 } 3025 }
3030 } // namespace 3026 } // namespace
3031 } // namespace test 3027 } // namespace test
3032 } // namespace net 3028 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_stream_sequencer_buffer_peer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698