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

Side by Side Diff: net/quic/core/quic_packet_generator_test.cc

Issue 2429533003: Deprecate FLAGS_quic_close_connection_on_huge_frames. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_packet_generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/core/quic_packet_generator.h" 5 #include "net/quic/core/quic_packet_generator.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 EXPECT_CALL(delegate_, OnSerializedPacket(_)) 872 EXPECT_CALL(delegate_, OnSerializedPacket(_))
873 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket)); 873 .WillOnce(Invoke(this, &QuicPacketGeneratorTest::SavePacket));
874 generator_.FlushAllQueuedFrames(); 874 generator_.FlushAllQueuedFrames();
875 EXPECT_FALSE(generator_.HasQueuedFrames()); 875 EXPECT_FALSE(generator_.HasQueuedFrames());
876 generator_.SetCurrentPath(kTestPathId1, 1, 0); 876 generator_.SetCurrentPath(kTestPathId1, 1, 0);
877 EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_)); 877 EXPECT_EQ(kTestPathId1, QuicPacketCreatorPeer::GetCurrentPath(creator_));
878 } 878 }
879 879
880 // Regression test for b/31486443. 880 // Regression test for b/31486443.
881 TEST_F(QuicPacketGeneratorTest, ConnectionCloseFrameLargerThanPacketSize) { 881 TEST_F(QuicPacketGeneratorTest, ConnectionCloseFrameLargerThanPacketSize) {
882 FLAGS_quic_close_connection_on_huge_frames = true;
883 delegate_.SetCanWriteAnything(); 882 delegate_.SetCanWriteAnything();
884 QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame(); 883 QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame();
885 frame->error_code = QUIC_PACKET_WRITE_ERROR; 884 frame->error_code = QUIC_PACKET_WRITE_ERROR;
886 char buf[2000]; 885 char buf[2000];
887 StringPiece error_details(buf, 2000); 886 StringPiece error_details(buf, 2000);
888 frame->error_details = error_details.as_string(); 887 frame->error_details = error_details.as_string();
889 EXPECT_CALL(delegate_, 888 EXPECT_CALL(delegate_,
890 OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET, 889 OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET,
891 "Single frame cannot fit into a packet", _)); 890 "Single frame cannot fit into a packet", _));
892 EXPECT_QUIC_BUG(generator_.AddControlFrame(QuicFrame(frame)), ""); 891 EXPECT_QUIC_BUG(generator_.AddControlFrame(QuicFrame(frame)), "");
893 EXPECT_TRUE(generator_.HasQueuedFrames()); 892 EXPECT_TRUE(generator_.HasQueuedFrames());
894 } 893 }
895 894
896 } // namespace test 895 } // namespace test
897 } // namespace net 896 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_packet_generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698