| OLD | NEW |
| 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 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 | 626 |
| 627 // Run all end to end tests with all supported versions. | 627 // Run all end to end tests with all supported versions. |
| 628 INSTANTIATE_TEST_CASE_P(EndToEndTests, | 628 INSTANTIATE_TEST_CASE_P(EndToEndTests, |
| 629 EndToEndTest, | 629 EndToEndTest, |
| 630 ::testing::ValuesIn(GetTestParams())); | 630 ::testing::ValuesIn(GetTestParams())); |
| 631 | 631 |
| 632 TEST_P(EndToEndTest, HandshakeSuccessful) { | 632 TEST_P(EndToEndTest, HandshakeSuccessful) { |
| 633 ASSERT_TRUE(Initialize()); | 633 ASSERT_TRUE(Initialize()); |
| 634 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); | 634 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); |
| 635 QuicCryptoStream* crypto_stream = | 635 QuicCryptoStream* crypto_stream = |
| 636 QuicSessionPeer::GetCryptoStream(client_->client()->session()); | 636 QuicSessionPeer::GetMutableCryptoStream(client_->client()->session()); |
| 637 QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(crypto_stream); | 637 QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(crypto_stream); |
| 638 EXPECT_NE(FLAGS_quic_reloadable_flag_quic_release_crypto_stream_buffer, | 638 EXPECT_NE(FLAGS_quic_reloadable_flag_quic_release_crypto_stream_buffer, |
| 639 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); | 639 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); |
| 640 server_thread_->Pause(); | 640 server_thread_->Pause(); |
| 641 QuicDispatcher* dispatcher = | 641 QuicDispatcher* dispatcher = |
| 642 QuicServerPeer::GetDispatcher(server_thread_->server()); | 642 QuicServerPeer::GetDispatcher(server_thread_->server()); |
| 643 QuicSession* server_session = dispatcher->session_map().begin()->second.get(); | 643 QuicSession* server_session = dispatcher->session_map().begin()->second.get(); |
| 644 crypto_stream = QuicSessionPeer::GetCryptoStream(server_session); | 644 crypto_stream = QuicSessionPeer::GetMutableCryptoStream(server_session); |
| 645 sequencer = QuicStreamPeer::sequencer(crypto_stream); | 645 sequencer = QuicStreamPeer::sequencer(crypto_stream); |
| 646 EXPECT_NE(FLAGS_quic_reloadable_flag_quic_release_crypto_stream_buffer, | 646 EXPECT_NE(FLAGS_quic_reloadable_flag_quic_release_crypto_stream_buffer, |
| 647 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); | 647 QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer)); |
| 648 } | 648 } |
| 649 | 649 |
| 650 TEST_P(EndToEndTest, SimpleRequestResponsev6) { | 650 TEST_P(EndToEndTest, SimpleRequestResponsev6) { |
| 651 ASSERT_TRUE(Initialize()); | 651 ASSERT_TRUE(Initialize()); |
| 652 | 652 |
| 653 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); | 653 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); |
| 654 EXPECT_EQ("200", client_->response_headers()->find(":status")->second); | 654 EXPECT_EQ("200", client_->response_headers()->find(":status")->second); |
| (...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 | 1757 |
| 1758 ASSERT_TRUE(Initialize()); | 1758 ASSERT_TRUE(Initialize()); |
| 1759 | 1759 |
| 1760 // Wait for crypto handshake to finish. This should have contributed to the | 1760 // Wait for crypto handshake to finish. This should have contributed to the |
| 1761 // crypto stream flow control window, but not affected the session flow | 1761 // crypto stream flow control window, but not affected the session flow |
| 1762 // control window. | 1762 // control window. |
| 1763 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); | 1763 EXPECT_TRUE(client_->client()->WaitForCryptoHandshakeConfirmed()); |
| 1764 server_thread_->WaitForCryptoHandshakeConfirmed(); | 1764 server_thread_->WaitForCryptoHandshakeConfirmed(); |
| 1765 | 1765 |
| 1766 QuicCryptoStream* crypto_stream = | 1766 QuicCryptoStream* crypto_stream = |
| 1767 QuicSessionPeer::GetCryptoStream(client_->client()->session()); | 1767 QuicSessionPeer::GetMutableCryptoStream(client_->client()->session()); |
| 1768 EXPECT_LT( | 1768 EXPECT_LT( |
| 1769 QuicFlowControllerPeer::SendWindowSize(crypto_stream->flow_controller()), | 1769 QuicFlowControllerPeer::SendWindowSize(crypto_stream->flow_controller()), |
| 1770 kStreamIFCW); | 1770 kStreamIFCW); |
| 1771 EXPECT_EQ(kSessionIFCW, QuicFlowControllerPeer::SendWindowSize( | 1771 EXPECT_EQ(kSessionIFCW, QuicFlowControllerPeer::SendWindowSize( |
| 1772 client_->client()->session()->flow_controller())); | 1772 client_->client()->session()->flow_controller())); |
| 1773 | 1773 |
| 1774 // Send a request with no body, and verify that the connection level window | 1774 // Send a request with no body, and verify that the connection level window |
| 1775 // has not been affected. | 1775 // has not been affected. |
| 1776 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); | 1776 EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo")); |
| 1777 | 1777 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 1808 | 1808 |
| 1809 server_thread_->Pause(); | 1809 server_thread_->Pause(); |
| 1810 QuicSpdySession* const client_session = client_->client()->session(); | 1810 QuicSpdySession* const client_session = client_->client()->session(); |
| 1811 QuicDispatcher* dispatcher = | 1811 QuicDispatcher* dispatcher = |
| 1812 QuicServerPeer::GetDispatcher(server_thread_->server()); | 1812 QuicServerPeer::GetDispatcher(server_thread_->server()); |
| 1813 auto* server_session = static_cast<QuicSpdySession*>( | 1813 auto* server_session = static_cast<QuicSpdySession*>( |
| 1814 dispatcher->session_map().begin()->second.get()); | 1814 dispatcher->session_map().begin()->second.get()); |
| 1815 ExpectFlowControlsSynced(client_session->flow_controller(), | 1815 ExpectFlowControlsSynced(client_session->flow_controller(), |
| 1816 server_session->flow_controller()); | 1816 server_session->flow_controller()); |
| 1817 ExpectFlowControlsSynced( | 1817 ExpectFlowControlsSynced( |
| 1818 QuicSessionPeer::GetCryptoStream(client_session)->flow_controller(), | 1818 QuicSessionPeer::GetMutableCryptoStream(client_session) |
| 1819 QuicSessionPeer::GetCryptoStream(server_session)->flow_controller()); | 1819 ->flow_controller(), |
| 1820 QuicSessionPeer::GetMutableCryptoStream(server_session) |
| 1821 ->flow_controller()); |
| 1820 SpdyFramer spdy_framer(SpdyFramer::ENABLE_COMPRESSION); | 1822 SpdyFramer spdy_framer(SpdyFramer::ENABLE_COMPRESSION); |
| 1821 SpdySettingsIR settings_frame; | 1823 SpdySettingsIR settings_frame; |
| 1822 settings_frame.AddSetting(SETTINGS_MAX_HEADER_LIST_SIZE, | 1824 settings_frame.AddSetting(SETTINGS_MAX_HEADER_LIST_SIZE, |
| 1823 kDefaultMaxUncompressedHeaderSize); | 1825 kDefaultMaxUncompressedHeaderSize); |
| 1824 SpdySerializedFrame frame(spdy_framer.SerializeFrame(settings_frame)); | 1826 SpdySerializedFrame frame(spdy_framer.SerializeFrame(settings_frame)); |
| 1825 QuicFlowController* client_header_stream_flow_controller = | 1827 QuicFlowController* client_header_stream_flow_controller = |
| 1826 QuicSpdySessionPeer::GetHeadersStream(client_session)->flow_controller(); | 1828 QuicSpdySessionPeer::GetHeadersStream(client_session)->flow_controller(); |
| 1827 QuicFlowController* server_header_stream_flow_controller = | 1829 QuicFlowController* server_header_stream_flow_controller = |
| 1828 QuicSpdySessionPeer::GetHeadersStream(server_session)->flow_controller(); | 1830 QuicSpdySessionPeer::GetHeadersStream(server_session)->flow_controller(); |
| 1829 if (FLAGS_quic_reloadable_flag_quic_send_max_header_list_size) { | 1831 if (FLAGS_quic_reloadable_flag_quic_send_max_header_list_size) { |
| (...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3068 client_->WaitForResponse(); | 3070 client_->WaitForResponse(); |
| 3069 EXPECT_EQ(kBarResponseBody, client_->response_body()); | 3071 EXPECT_EQ(kBarResponseBody, client_->response_body()); |
| 3070 QuicConnectionStats client_stats = | 3072 QuicConnectionStats client_stats = |
| 3071 client_->client()->session()->connection()->GetStats(); | 3073 client_->client()->session()->connection()->GetStats(); |
| 3072 EXPECT_EQ(0u, client_stats.packets_lost); | 3074 EXPECT_EQ(0u, client_stats.packets_lost); |
| 3073 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); | 3075 EXPECT_EQ(1, client_->client()->GetNumSentClientHellos()); |
| 3074 } | 3076 } |
| 3075 } // namespace | 3077 } // namespace |
| 3076 } // namespace test | 3078 } // namespace test |
| 3077 } // namespace net | 3079 } // namespace net |
| OLD | NEW |