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

Side by Side Diff: net/quic/quic_connection_test.cc

Issue 157913003: Remove parity tracking in FEC groups as part of the migration to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_fec_group.h » ('j') | 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 "net/quic/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2)); 1976 EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
1977 } 1977 }
1978 1978
1979 TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacketsThenFecPacket) { 1979 TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacketsThenFecPacket) {
1980 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); 1980 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
1981 1981
1982 ProcessFecProtectedPacket(1, false, !kEntropyFlag); 1982 ProcessFecProtectedPacket(1, false, !kEntropyFlag);
1983 // Don't send missing packet 2. 1983 // Don't send missing packet 2.
1984 ProcessFecProtectedPacket(3, false, !kEntropyFlag); 1984 ProcessFecProtectedPacket(3, false, !kEntropyFlag);
1985 ProcessFecPacket(4, 1, true, kEntropyFlag, NULL); 1985 ProcessFecPacket(4, 1, true, kEntropyFlag, NULL);
1986 // Entropy flag should be true, so entropy should not be 0. 1986 // Ensure QUIC no longer revives entropy for lost packets.
1987 EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2)); 1987 EXPECT_EQ(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
1988 EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 4));
1988 } 1989 }
1989 1990
1990 TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacket) { 1991 TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPacket) {
1991 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); 1992 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
1992 1993
1993 // Don't send missing packet 1. 1994 // Don't send missing packet 1.
1994 ProcessFecPacket(3, 1, false, !kEntropyFlag, NULL); 1995 ProcessFecPacket(3, 1, false, !kEntropyFlag, NULL);
1995 // Out of order. 1996 // Out of order.
1996 ProcessFecProtectedPacket(2, true, !kEntropyFlag); 1997 ProcessFecProtectedPacket(2, true, !kEntropyFlag);
1997 // Entropy flag should be false, so entropy should be 0. 1998 // Entropy flag should be false, so entropy should be 0.
1998 EXPECT_EQ(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2)); 1999 EXPECT_EQ(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
1999 } 2000 }
2000 2001
2001 TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPackets) { 2002 TEST_F(QuicConnectionTest, ReviveMissingPacketAfterDataPackets) {
2002 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); 2003 EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
2003 2004
2004 ProcessFecProtectedPacket(1, false, !kEntropyFlag); 2005 ProcessFecProtectedPacket(1, false, !kEntropyFlag);
2005 // Don't send missing packet 2. 2006 // Don't send missing packet 2.
2006 ProcessFecPacket(6, 1, false, kEntropyFlag, NULL); 2007 ProcessFecPacket(6, 1, false, kEntropyFlag, NULL);
2007 ProcessFecProtectedPacket(3, false, kEntropyFlag); 2008 ProcessFecProtectedPacket(3, false, kEntropyFlag);
2008 ProcessFecProtectedPacket(4, false, kEntropyFlag); 2009 ProcessFecProtectedPacket(4, false, kEntropyFlag);
2009 ProcessFecProtectedPacket(5, true, !kEntropyFlag); 2010 ProcessFecProtectedPacket(5, true, !kEntropyFlag);
2010 // Entropy flag should be true, so entropy should be 0. 2011 // Ensure entropy is not revived for the missing packet.
2011 EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2)); 2012 EXPECT_EQ(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 2));
2013 EXPECT_NE(0u, QuicConnectionPeer::ReceivedEntropyHash(&connection_, 3));
2012 } 2014 }
2013 2015
2014 TEST_F(QuicConnectionTest, RTO) { 2016 TEST_F(QuicConnectionTest, RTO) {
2015 QuicTime default_retransmission_time = clock_.ApproximateNow().Add( 2017 QuicTime default_retransmission_time = clock_.ApproximateNow().Add(
2016 DefaultRetransmissionTime()); 2018 DefaultRetransmissionTime());
2017 SendStreamDataToPeer(3, "foo", 0, !kFin, NULL); 2019 SendStreamDataToPeer(3, "foo", 0, !kFin, NULL);
2018 EXPECT_EQ(1u, outgoing_ack()->sent_info.least_unacked); 2020 EXPECT_EQ(1u, outgoing_ack()->sent_info.least_unacked);
2019 2021
2020 EXPECT_EQ(1u, last_header()->packet_sequence_number); 2022 EXPECT_EQ(1u, last_header()->packet_sequence_number);
2021 EXPECT_EQ(default_retransmission_time, 2023 EXPECT_EQ(default_retransmission_time,
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
3463 true); 3465 true);
3464 TestConnection client(guid_, IPEndPoint(), helper_.get(), writer_.get(), 3466 TestConnection client(guid_, IPEndPoint(), helper_.get(), writer_.get(),
3465 false); 3467 false);
3466 EXPECT_TRUE(client.sent_packet_manager().using_pacing()); 3468 EXPECT_TRUE(client.sent_packet_manager().using_pacing());
3467 EXPECT_FALSE(server.sent_packet_manager().using_pacing()); 3469 EXPECT_FALSE(server.sent_packet_manager().using_pacing());
3468 } 3470 }
3469 3471
3470 } // namespace 3472 } // namespace
3471 } // namespace test 3473 } // namespace test
3472 } // namespace net 3474 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_fec_group.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698