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

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

Issue 514033002: Optimize QuicUnackedPacketMap by changing from a LinkedHashMap to a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unit_test_for_empty_packet_74041239
Patch Set: Created 6 years, 3 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
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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 Return(kMaxPacketSize * 256 * 256 * 256 * 256)); 1393 Return(kMaxPacketSize * 256 * 256 * 256 * 256));
1394 1394
1395 SendStreamDataToPeer(1, "foo", 12, !kFin, &last_packet); 1395 SendStreamDataToPeer(1, "foo", 12, !kFin, &last_packet);
1396 EXPECT_EQ(5u, last_packet); 1396 EXPECT_EQ(5u, last_packet);
1397 EXPECT_EQ(PACKET_6BYTE_SEQUENCE_NUMBER, 1397 EXPECT_EQ(PACKET_6BYTE_SEQUENCE_NUMBER,
1398 creator->next_sequence_number_length()); 1398 creator->next_sequence_number_length());
1399 EXPECT_EQ(PACKET_4BYTE_SEQUENCE_NUMBER, 1399 EXPECT_EQ(PACKET_4BYTE_SEQUENCE_NUMBER,
1400 writer_->header().public_header.sequence_number_length); 1400 writer_->header().public_header.sequence_number_length);
1401 } 1401 }
1402 1402
1403 TEST_P(QuicConnectionTest, SendingDifferentSequenceNumberLengthsUnackedDelta) { 1403 // TODO(ianswett): Re-enable this test by finding a good way to test different
1404 // sequence number lengths without sending packets with giant gaps.
1405 TEST_P(QuicConnectionTest,
1406 DISABLED_SendingDifferentSequenceNumberLengthsUnackedDelta) {
1404 QuicPacketSequenceNumber last_packet; 1407 QuicPacketSequenceNumber last_packet;
1405 QuicPacketCreator* creator = 1408 QuicPacketCreator* creator =
1406 QuicConnectionPeer::GetPacketCreator(&connection_); 1409 QuicConnectionPeer::GetPacketCreator(&connection_);
1407 SendStreamDataToPeer(1, "foo", 0, !kFin, &last_packet); 1410 SendStreamDataToPeer(1, "foo", 0, !kFin, &last_packet);
1408 EXPECT_EQ(1u, last_packet); 1411 EXPECT_EQ(1u, last_packet);
1409 EXPECT_EQ(PACKET_1BYTE_SEQUENCE_NUMBER, 1412 EXPECT_EQ(PACKET_1BYTE_SEQUENCE_NUMBER,
1410 creator->next_sequence_number_length()); 1413 creator->next_sequence_number_length());
1411 EXPECT_EQ(PACKET_1BYTE_SEQUENCE_NUMBER, 1414 EXPECT_EQ(PACKET_1BYTE_SEQUENCE_NUMBER,
1412 writer_->header().public_header.sequence_number_length); 1415 writer_->header().public_header.sequence_number_length);
1413 1416
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after
4001 QuicBlockedFrame blocked; 4004 QuicBlockedFrame blocked;
4002 blocked.stream_id = 3; 4005 blocked.stream_id = 3;
4003 EXPECT_CALL(visitor_, OnBlockedFrames(_)); 4006 EXPECT_CALL(visitor_, OnBlockedFrames(_));
4004 ProcessFramePacket(QuicFrame(&blocked)); 4007 ProcessFramePacket(QuicFrame(&blocked));
4005 EXPECT_TRUE(ack_alarm->IsSet()); 4008 EXPECT_TRUE(ack_alarm->IsSet());
4006 } 4009 }
4007 4010
4008 } // namespace 4011 } // namespace
4009 } // namespace test 4012 } // namespace test
4010 } // namespace net 4013 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/time_loss_algorithm.cc ('k') | net/quic/quic_sent_entropy_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698