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

Unified Diff: net/quic/quic_connection_test.cc

Issue 25443002: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix to change SendAlarm crash Created 7 years, 2 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_sent_packet_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 921ca9cc2b462bcf86967c27d4951fce8a7a9e7d..102bb3340ae4be4157c3eda946e4391e34f6fe7c 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -476,6 +476,11 @@ class TestConnection : public QuicConnection {
QuicConnectionPeer::GetSendAlarm(this));
}
+ TestConnectionHelper::TestAlarm* GetResumeWritesAlarm() {
+ return reinterpret_cast<TestConnectionHelper::TestAlarm*>(
+ QuicConnectionPeer::GetResumeWritesAlarm(this));
+ }
+
TestConnectionHelper::TestAlarm* GetTimeoutAlarm() {
return reinterpret_cast<TestConnectionHelper::TestAlarm*>(
QuicConnectionPeer::GetTimeoutAlarm(this));
@@ -1699,6 +1704,18 @@ TEST_P(QuicConnectionTest, QueueAfterTwoRTOs) {
connection_.OnCanWrite();
}
+TEST_P(QuicConnectionTest, ResumptionAlarmThenWriteBlocked) {
+ // Set the send and resumption alarm, then block the connection.
+ connection_.GetResumeWritesAlarm()->Set(clock_.ApproximateNow());
+ connection_.GetSendAlarm()->Set(clock_.ApproximateNow());
+ QuicConnectionPeer::SetIsWriteBlocked(&connection_, true);
+
+ // Fire the alarms and ensure the connection is still write blocked.
+ connection_.GetResumeWritesAlarm()->Fire();
+ connection_.GetSendAlarm()->Fire();
+ EXPECT_TRUE(QuicConnectionPeer::IsWriteBlocked(&connection_));
+}
+
TEST_P(QuicConnectionTest, LimitPacketsPerNack) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
EXPECT_CALL(*send_algorithm_, OnIncomingAck(12, _, _)).Times(1);
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_sent_packet_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698