| 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 "net/quic/reliable_quic_stream.h" | 5 #include "net/quic/reliable_quic_stream.h" |
| 6 | 6 |
| 7 #include "net/quic/quic_ack_notifier.h" | 7 #include "net/quic/quic_ack_notifier.h" |
| 8 #include "net/quic/quic_connection.h" | 8 #include "net/quic/quic_connection.h" |
| 9 #include "net/quic/quic_flags.h" | |
| 10 #include "net/quic/quic_utils.h" | 9 #include "net/quic/quic_utils.h" |
| 11 #include "net/quic/quic_write_blocked_list.h" | 10 #include "net/quic/quic_write_blocked_list.h" |
| 12 #include "net/quic/spdy_utils.h" | 11 #include "net/quic/spdy_utils.h" |
| 13 #include "net/quic/test_tools/quic_config_peer.h" | 12 #include "net/quic/test_tools/quic_config_peer.h" |
| 14 #include "net/quic/test_tools/quic_connection_peer.h" | 13 #include "net/quic/test_tools/quic_connection_peer.h" |
| 15 #include "net/quic/test_tools/quic_flow_controller_peer.h" | 14 #include "net/quic/test_tools/quic_flow_controller_peer.h" |
| 16 #include "net/quic/test_tools/quic_session_peer.h" | 15 #include "net/quic/test_tools/quic_session_peer.h" |
| 17 #include "net/quic/test_tools/quic_test_utils.h" | 16 #include "net/quic/test_tools/quic_test_utils.h" |
| 18 #include "net/quic/test_tools/reliable_quic_stream_peer.h" | 17 #include "net/quic/test_tools/reliable_quic_stream_peer.h" |
| 19 #include "net/test/gtest_util.h" | 18 #include "net/test/gtest_util.h" |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 // The FIN has been received but not consumed. | 691 // The FIN has been received but not consumed. |
| 693 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); | 692 EXPECT_TRUE(stream_->HasFinalReceivedByteOffset()); |
| 694 EXPECT_FALSE(stream_->read_side_closed()); | 693 EXPECT_FALSE(stream_->read_side_closed()); |
| 695 | 694 |
| 696 EXPECT_EQ(1u, QuicSessionPeer::GetDrainingStreams(session_.get()) | 695 EXPECT_EQ(1u, QuicSessionPeer::GetDrainingStreams(session_.get()) |
| 697 ->count(kTestStreamId)); | 696 ->count(kTestStreamId)); |
| 698 EXPECT_EQ(0u, session_->GetNumOpenStreams()); | 697 EXPECT_EQ(0u, session_->GetNumOpenStreams()); |
| 699 } | 698 } |
| 700 | 699 |
| 701 TEST_F(ReliableQuicStreamTest, FecSendPolicyReceivedConnectionOption) { | 700 TEST_F(ReliableQuicStreamTest, FecSendPolicyReceivedConnectionOption) { |
| 702 ValueRestore<bool> old_flag(&FLAGS_quic_send_fec_packet_only_on_fec_alarm, | |
| 703 true); | |
| 704 Initialize(kShouldProcessData); | 701 Initialize(kShouldProcessData); |
| 705 | 702 |
| 706 // Test ReceivedConnectionOptions. | 703 // Test ReceivedConnectionOptions. |
| 707 QuicConfig* config = session_->config(); | 704 QuicConfig* config = session_->config(); |
| 708 QuicTagVector copt; | 705 QuicTagVector copt; |
| 709 copt.push_back(kFSTR); | 706 copt.push_back(kFSTR); |
| 710 QuicConfigPeer::SetReceivedConnectionOptions(config, copt); | 707 QuicConfigPeer::SetReceivedConnectionOptions(config, copt); |
| 711 EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream_->fec_policy()); | 708 EXPECT_EQ(FEC_PROTECT_OPTIONAL, stream_->fec_policy()); |
| 712 stream_->SetFromConfig(); | 709 stream_->SetFromConfig(); |
| 713 EXPECT_EQ(FEC_PROTECT_ALWAYS, stream_->fec_policy()); | 710 EXPECT_EQ(FEC_PROTECT_ALWAYS, stream_->fec_policy()); |
| 714 } | 711 } |
| 715 | 712 |
| 716 } // namespace | 713 } // namespace |
| 717 } // namespace test | 714 } // namespace test |
| 718 } // namespace net | 715 } // namespace net |
| OLD | NEW |