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

Unified Diff: net/tools/quic/quic_time_wait_list_manager_test.cc

Issue 2846013002: Remove unused packet_number parameter from multiple functions in QUIC. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: net/tools/quic/quic_time_wait_list_manager_test.cc
diff --git a/net/tools/quic/quic_time_wait_list_manager_test.cc b/net/tools/quic/quic_time_wait_list_manager_test.cc
index b1bcf26c35e7a6dbfc134a535386b07b75879bf3..e8da20f08cc7aae9c4723f94d44d07b1e9795846 100644
--- a/net/tools/quic/quic_time_wait_list_manager_test.cc
+++ b/net/tools/quic/quic_time_wait_list_manager_test.cc
@@ -114,11 +114,10 @@ class QuicTimeWaitListManagerTest : public ::testing::Test {
return time_wait_list_manager_.IsConnectionIdInTimeWait(connection_id);
}
- void ProcessPacket(QuicConnectionId connection_id,
- QuicPacketNumber packet_number) {
+ void ProcessPacket(QuicConnectionId connection_id) {
QuicEncryptedPacket packet(nullptr, 0);
time_wait_list_manager_.ProcessPacket(server_address_, client_address_,
- connection_id, packet_number, packet);
+ connection_id, packet);
}
QuicEncryptedPacket* ConstructEncryptedPacket(
@@ -218,12 +217,11 @@ TEST_F(QuicTimeWaitListManagerTest, SendConnectionClose) {
AddConnectionId(connection_id_, QuicVersionMax(),
/*connection_rejected_statelessly=*/false,
&termination_packets);
- const int kRandomSequenceNumber = 1;
EXPECT_CALL(writer_, WritePacket(_, kConnectionCloseLength,
server_address_.host(), client_address_, _))
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1)));
- ProcessPacket(connection_id_, kRandomSequenceNumber);
+ ProcessPacket(connection_id_);
}
TEST_F(QuicTimeWaitListManagerTest, SendTwoConnectionCloses) {
@@ -239,25 +237,23 @@ TEST_F(QuicTimeWaitListManagerTest, SendTwoConnectionCloses) {
AddConnectionId(connection_id_, QuicVersionMax(),
/*connection_rejected_statelessly=*/false,
&termination_packets);
- const int kRandomSequenceNumber = 1;
EXPECT_CALL(writer_, WritePacket(_, kConnectionCloseLength,
server_address_.host(), client_address_, _))
.Times(2)
.WillRepeatedly(Return(WriteResult(WRITE_STATUS_OK, 1)));
- ProcessPacket(connection_id_, kRandomSequenceNumber);
+ ProcessPacket(connection_id_);
}
TEST_F(QuicTimeWaitListManagerTest, SendPublicReset) {
EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_));
AddConnectionId(connection_id_);
- const int kRandomSequenceNumber = 1;
EXPECT_CALL(writer_,
WritePacket(_, _, server_address_.host(), client_address_, _))
.With(Args<0, 1>(PublicResetPacketEq(connection_id_)))
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0)));
- ProcessPacket(connection_id_, kRandomSequenceNumber);
+ ProcessPacket(connection_id_);
}
TEST_F(QuicTimeWaitListManagerTest, SendPublicResetWithExponentialBackOff) {
@@ -269,7 +265,7 @@ TEST_F(QuicTimeWaitListManagerTest, SendPublicResetWithExponentialBackOff) {
EXPECT_CALL(writer_, WritePacket(_, _, _, _, _))
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1)));
}
- ProcessPacket(connection_id_, packet_number);
+ ProcessPacket(connection_id_);
// Send public reset with exponential back off.
if ((packet_number & (packet_number - 1)) == 0) {
EXPECT_TRUE(QuicTimeWaitListManagerPeer::ShouldSendResponse(
@@ -284,13 +280,12 @@ TEST_F(QuicTimeWaitListManagerTest, SendPublicResetWithExponentialBackOff) {
TEST_F(QuicTimeWaitListManagerTest, NoPublicResetForStatelessConnections) {
EXPECT_CALL(visitor_, OnConnectionAddedToTimeWaitList(connection_id_));
AddStatelessConnectionId(connection_id_);
- const int kRandomSequenceNumber = 1;
EXPECT_CALL(writer_,
WritePacket(_, _, server_address_.host(), client_address_, _))
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1)));
- ProcessPacket(connection_id_, kRandomSequenceNumber);
+ ProcessPacket(connection_id_);
}
TEST_F(QuicTimeWaitListManagerTest, CleanUpOldConnectionIds) {
@@ -351,7 +346,7 @@ TEST_F(QuicTimeWaitListManagerTest, SendQueuedPackets) {
WritePacket(_, _, server_address_.host(), client_address_, _))
.With(Args<0, 1>(PublicResetPacketEq(connection_id)))
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, packet->length())));
- ProcessPacket(connection_id, packet_number);
+ ProcessPacket(connection_id);
// write block for the next packet.
EXPECT_CALL(writer_,
@@ -360,9 +355,9 @@ TEST_F(QuicTimeWaitListManagerTest, SendQueuedPackets) {
.WillOnce(DoAll(Assign(&writer_is_blocked_, true),
Return(WriteResult(WRITE_STATUS_BLOCKED, EAGAIN))));
EXPECT_CALL(visitor_, OnWriteBlocked(&time_wait_list_manager_));
- ProcessPacket(connection_id, packet_number);
+ ProcessPacket(connection_id);
// 3rd packet. No public reset should be sent;
- ProcessPacket(connection_id, packet_number);
+ ProcessPacket(connection_id);
// write packet should not be called since we are write blocked but the
// should be queued.
@@ -374,7 +369,7 @@ TEST_F(QuicTimeWaitListManagerTest, SendQueuedPackets) {
ConstructEncryptedPacket(other_connection_id, other_packet_number));
EXPECT_CALL(writer_, WritePacket(_, _, _, _, _)).Times(0);
EXPECT_CALL(visitor_, OnWriteBlocked(&time_wait_list_manager_));
- ProcessPacket(other_connection_id, other_packet_number);
+ ProcessPacket(other_connection_id);
EXPECT_EQ(2u, time_wait_list_manager_.num_connections());
// Now expect all the write blocked public reset packets to be sent again.
@@ -437,8 +432,7 @@ TEST_F(QuicTimeWaitListManagerTest, AddConnectionIdTwice) {
server_address_.host(), client_address_, _))
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, 1)));
- const int kRandomSequenceNumber = 1;
- ProcessPacket(connection_id_, kRandomSequenceNumber);
+ ProcessPacket(connection_id_);
const QuicTime::Delta time_wait_period =
QuicTimeWaitListManagerPeer::time_wait_period(&time_wait_list_manager_);
« no previous file with comments | « net/tools/quic/quic_time_wait_list_manager.cc ('k') | net/tools/quic/test_tools/mock_quic_time_wait_list_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698