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

Unified Diff: net/quic/core/quic_framer_test.cc

Issue 2962203002: Replace a DCHECK with a return false, when processing invalid stop waiting data. (Closed)
Patch Set: Created 3 years, 6 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/core/quic_framer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_framer_test.cc
diff --git a/net/quic/core/quic_framer_test.cc b/net/quic/core/quic_framer_test.cc
index ed3979b86b64e1f93e71fafcf2f0d6fc430d33e9..34337faac80640397ba588ec3978d5eb081c97f0 100644
--- a/net/quic/core/quic_framer_test.cc
+++ b/net/quic/core/quic_framer_test.cc
@@ -2079,6 +2079,47 @@ TEST_P(QuicFramerTest, NewStopWaitingFrame) {
}
}
+TEST_P(QuicFramerTest, InvalidNewStopWaitingFrame) {
+ // clang-format off
+ unsigned char packet[] = {
+ // public flags (8 byte connection_id)
+ 0x3C,
+ // connection_id
+ 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
+ // packet number
+ 0xA8, 0x9A, 0x78, 0x56,
+ 0x34, 0x12,
+ // frame type (stop waiting frame)
+ 0x06,
+ // least packet number awaiting an ack, delta from packet number.
+ 0xA8, 0x9A, 0x78, 0x56,
+ 0x34, 0x13,
+ };
+
+ unsigned char packet39[] = {
+ // public flags (8 byte connection_id)
+ 0x3C,
+ // connection_id
+ 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10,
+ // packet number
+ 0x12, 0x34, 0x56, 0x78,
+ 0x9A, 0xA8,
+ // frame type (stop waiting frame)
+ 0x06,
+ // least packet number awaiting an ack, delta from packet number.
+ 0x13, 0x34, 0x56, 0x78,
+ 0x9A, 0xA8,
+ };
+ // clang-format on
+
+ QuicEncryptedPacket encrypted(
+ AsChars(framer_.version() <= QUIC_VERSION_38 ? packet : packet39),
+ arraysize(packet), false);
+ EXPECT_FALSE(framer_.ProcessPacket(encrypted));
+ EXPECT_EQ(QUIC_INVALID_STOP_WAITING_DATA, framer_.error());
+ EXPECT_EQ("Invalid unacked delta.", framer_.detailed_error());
+}
+
TEST_P(QuicFramerTest, RstStreamFrameQuic) {
// clang-format off
unsigned char packet[] = {
« no previous file with comments | « net/quic/core/quic_framer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698