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

Unified Diff: net/quic/quic_packet_generator_test.cc

Issue 839143002: Roll Chrome into Mojo. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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_packet_generator.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_generator_test.cc
diff --git a/net/quic/quic_packet_generator_test.cc b/net/quic/quic_packet_generator_test.cc
index 7eea015f022342ed4ff2050a82247b695bde0c69..f7a7d72ab60a96a7a80fc5bbe64cdbd4daaea048 100644
--- a/net/quic/quic_packet_generator_test.cc
+++ b/net/quic/quic_packet_generator_test.cc
@@ -16,6 +16,7 @@
#include "net/quic/test_tools/quic_packet_generator_peer.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "net/quic/test_tools/simple_quic_framer.h"
+#include "net/test/gtest_util.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -429,6 +430,13 @@ TEST_F(QuicPacketGeneratorTest, ConsumeData_WritableAndShouldFlush) {
CheckPacketContains(contents, packet_);
}
+TEST_F(QuicPacketGeneratorTest, ConsumeData_EmptyData) {
+ ValueRestore<bool> old_flag(&FLAGS_quic_empty_data_no_fin_early_return, true);
+ EXPECT_DFATAL(generator_.ConsumeData(kHeadersStreamId, MakeIOVector(""), 0,
+ false, MAY_FEC_PROTECT, nullptr),
+ "Attempt to consume empty data without FIN.");
+}
+
TEST_F(QuicPacketGeneratorTest,
ConsumeDataMultipleTimes_WritableAndShouldNotFlush) {
delegate_.SetCanWriteAnything();
@@ -578,6 +586,12 @@ TEST_F(QuicPacketGeneratorTest, ConsumeData_FramesPreviouslyQueued) {
CheckPacketContains(contents, packet2_);
}
+TEST_F(QuicPacketGeneratorTest, FecTimeoutOnRttChange) {
+ EXPECT_EQ(QuicTime::Delta::Zero(), generator_.fec_timeout());
+ generator_.OnRttChange(QuicTime::Delta::FromMilliseconds(300));
+ EXPECT_EQ(QuicTime::Delta::FromMilliseconds(150), generator_.fec_timeout());
+}
+
TEST_F(QuicPacketGeneratorTest, FecGroupSizeOnCongestionWindowChange) {
delegate_.SetCanWriteAnything();
creator_->set_max_packets_per_fec_group(50);
« no previous file with comments | « net/quic/quic_packet_generator.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698