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

Unified Diff: net/quic/quic_connection_test.cc

Issue 1782053003: Optionally defer responding to a QUIC ACK until all ACK processing has completed for an EpollServer… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@115992556
Patch Set: Created 4 years, 9 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 | « net/quic/quic_connection.cc ('k') | net/quic/quic_flags.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 535282a178b63f638665d9e34c77615f55e9923a..42ecdbba9da95c2f7abfe1b863969e15fef99dbe 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -617,6 +617,7 @@ class TestConnection : public QuicConnection {
}
using QuicConnection::SelectMutualVersion;
+ using QuicConnection::set_defer_send_in_response_to_packets;
private:
TestPacketWriter* writer() {
@@ -641,19 +642,29 @@ class FecQuicConnectionDebugVisitor : public QuicConnectionDebugVisitor {
QuicPacketHeader revived_header_;
};
-// Run tests with combinations of {QuicVersion, fec_send_policy}.
+enum class AckResponse { kDefer, kImmediate };
+
+// Run tests with combinations of {QuicVersion, fec_send_policy,
+// AckResponse}.
struct TestParams {
- TestParams(QuicVersion version, FecSendPolicy fec_send_policy)
- : version(version), fec_send_policy(fec_send_policy) {}
+ TestParams(QuicVersion version,
+ FecSendPolicy fec_send_policy,
+ AckResponse ack_response)
+ : version(version),
+ fec_send_policy(fec_send_policy),
+ ack_response(ack_response) {}
friend ostream& operator<<(ostream& os, const TestParams& p) {
os << "{ client_version: " << QuicVersionToString(p.version)
- << " fec_send_policy: " << p.fec_send_policy << " }";
+ << " fec_send_policy: " << p.fec_send_policy << " ack_response: "
+ << (p.ack_response == AckResponse::kDefer ? "defer" : "immediate")
+ << " }";
return os;
}
QuicVersion version;
FecSendPolicy fec_send_policy;
+ AckResponse ack_response;
};
// Constructs various test permutations.
@@ -661,8 +672,13 @@ vector<TestParams> GetTestParams() {
vector<TestParams> params;
QuicVersionVector all_supported_versions = QuicSupportedVersions();
for (size_t i = 0; i < all_supported_versions.size(); ++i) {
- params.push_back(TestParams(all_supported_versions[i], FEC_ANY_TRIGGER));
- params.push_back(TestParams(all_supported_versions[i], FEC_ALARM_TRIGGER));
+ for (FecSendPolicy fec_send_policy : {FEC_ANY_TRIGGER, FEC_ALARM_TRIGGER}) {
+ for (AckResponse ack_response :
+ {AckResponse::kDefer, AckResponse::kImmediate}) {
+ params.push_back(TestParams(all_supported_versions[i], fec_send_policy,
+ ack_response));
+ }
+ }
}
return params;
}
@@ -696,6 +712,8 @@ class QuicConnectionTest : public ::testing::TestWithParam<TestParams> {
frame2_(1, false, 3, StringPiece(data2)),
packet_number_length_(PACKET_6BYTE_PACKET_NUMBER),
connection_id_length_(PACKET_8BYTE_CONNECTION_ID) {
+ connection_.set_defer_send_in_response_to_packets(GetParam().ack_response ==
+ AckResponse::kDefer);
FLAGS_quic_always_log_bugs_for_tests = true;
connection_.set_visitor(&visitor_);
connection_.SetSendAlgorithm(send_algorithm_);
@@ -762,6 +780,9 @@ class QuicConnectionTest : public ::testing::TestWithParam<TestParams> {
void ProcessPacket(QuicPathId path_id, QuicPacketNumber number) {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(1);
ProcessDataPacket(path_id, number, 0, !kEntropyFlag);
+ if (connection_.GetSendAlarm()->IsSet()) {
+ connection_.GetSendAlarm()->Fire();
+ }
}
QuicPacketEntropyHash ProcessFramePacket(QuicFrame frame) {
@@ -785,6 +806,9 @@ class QuicConnectionTest : public ::testing::TestWithParam<TestParams> {
self_address, peer_address,
QuicEncryptedPacket(serialized_packet.encrypted_buffer,
serialized_packet.encrypted_length));
+ if (connection_.GetSendAlarm()->IsSet()) {
+ connection_.GetSendAlarm()->Fire();
+ }
return serialized_packet.entropy_hash;
}
@@ -834,6 +858,9 @@ class QuicConnectionTest : public ::testing::TestWithParam<TestParams> {
connection_.ProcessUdpPacket(
kSelfAddress, kPeerAddress,
QuicEncryptedPacket(buffer, encrypted_length, false));
+ if (connection_.GetSendAlarm()->IsSet()) {
+ connection_.GetSendAlarm()->Fire();
+ }
return encrypted_length;
}
@@ -946,6 +973,9 @@ class QuicConnectionTest : public ::testing::TestWithParam<TestParams> {
connection_.ProcessUdpPacket(
kSelfAddress, kPeerAddress,
QuicEncryptedPacket(buffer, encrypted_length, false));
+ if (connection_.GetSendAlarm()->IsSet()) {
+ connection_.GetSendAlarm()->Fire();
+ }
return encrypted_length;
}
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698