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

Unified Diff: net/quic/quic_connection_test.cc

Issue 479463002: Improve QUIC's SentEntropyManagerTest and removing a test from (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delete_include_linked_hash_map_h_73256287
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | net/quic/quic_sent_entropy_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_test.cc
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index f798b37fd2a27ccf523320795c68ad8bd72f5923..db62ef4b9ee2fc62d35248ac1d635b5dbbcfb1d4 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -904,15 +904,12 @@ class QuicConnectionTest : public ::testing::TestWithParam<QuicVersion> {
frame.least_unacked = least_unacked;
return frame;
}
+
// Explicitly nack a packet.
void NackPacket(QuicPacketSequenceNumber missing, QuicAckFrame* frame) {
frame->missing_packets.insert(missing);
frame->entropy_hash ^=
- QuicConnectionPeer::GetSentEntropyHash(&connection_, missing);
- if (missing > 1) {
- frame->entropy_hash ^=
- QuicConnectionPeer::GetSentEntropyHash(&connection_, missing - 1);
- }
+ QuicConnectionPeer::PacketEntropy(&connection_, missing);
}
// Undo nacking a packet within the frame.
@@ -920,11 +917,7 @@ class QuicConnectionTest : public ::testing::TestWithParam<QuicVersion> {
EXPECT_THAT(frame->missing_packets, Contains(arrived));
frame->missing_packets.erase(arrived);
frame->entropy_hash ^=
- QuicConnectionPeer::GetSentEntropyHash(&connection_, arrived);
- if (arrived > 1) {
- frame->entropy_hash ^=
- QuicConnectionPeer::GetSentEntropyHash(&connection_, arrived - 1);
- }
+ QuicConnectionPeer::PacketEntropy(&connection_, arrived);
}
void TriggerConnectionClose() {
@@ -3249,35 +3242,6 @@ TEST_P(QuicConnectionTest, EntropyCalculationForTruncatedAck) {
}
}
-TEST_P(QuicConnectionTest, CheckSentEntropyHash) {
- peer_creator_.set_sequence_number(1);
- SequenceNumberSet missing_packets;
- QuicPacketEntropyHash entropy_hash = 0;
- QuicPacketSequenceNumber max_sequence_number = 51;
- for (QuicPacketSequenceNumber i = 1; i <= max_sequence_number; ++i) {
- bool is_missing = i % 10 != 0;
- bool entropy_flag = (i & (i - 1)) != 0;
- QuicPacketEntropyHash packet_entropy_hash = 0;
- if (entropy_flag) {
- packet_entropy_hash = 1 << (i % 8);
- }
- QuicPacket* packet = ConstructDataPacket(i, 0, entropy_flag);
- connection_.SendPacket(
- ENCRYPTION_NONE, i, packet, packet_entropy_hash,
- HAS_RETRANSMITTABLE_DATA);
-
- if (is_missing) {
- missing_packets.insert(i);
- continue;
- }
-
- entropy_hash ^= packet_entropy_hash;
- }
- EXPECT_TRUE(QuicConnectionPeer::IsValidEntropy(
- &connection_, max_sequence_number, missing_packets, entropy_hash))
- << "";
-}
-
TEST_P(QuicConnectionTest, ServerSendsVersionNegotiationPacket) {
connection_.SetSupportedVersions(QuicSupportedVersions());
framer_.set_version_for_tests(QUIC_VERSION_UNSUPPORTED);
« no previous file with comments | « no previous file | net/quic/quic_sent_entropy_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698