OLD | NEW |
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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 EXPECT_QUIC_BUG(generator_.FinishBatchOperations(), | 845 EXPECT_QUIC_BUG(generator_.FinishBatchOperations(), |
846 "packet_number_length 1 is too small " | 846 "packet_number_length 1 is too small " |
847 "for least_unacked_delta: 1001"); | 847 "for least_unacked_delta: 1001"); |
848 } | 848 } |
849 | 849 |
850 // Regression test for b/31486443. | 850 // Regression test for b/31486443. |
851 TEST_F(QuicPacketGeneratorTest, ConnectionCloseFrameLargerThanPacketSize) { | 851 TEST_F(QuicPacketGeneratorTest, ConnectionCloseFrameLargerThanPacketSize) { |
852 delegate_.SetCanWriteAnything(); | 852 delegate_.SetCanWriteAnything(); |
853 QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame(); | 853 QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame(); |
854 frame->error_code = QUIC_PACKET_WRITE_ERROR; | 854 frame->error_code = QUIC_PACKET_WRITE_ERROR; |
855 char buf[2000]; | 855 char buf[2000] = {}; |
856 QuicStringPiece error_details(buf, 2000); | 856 QuicStringPiece error_details(buf, 2000); |
857 frame->error_details = error_details.as_string(); | 857 frame->error_details = error_details.as_string(); |
858 EXPECT_CALL(delegate_, | 858 EXPECT_CALL(delegate_, |
859 OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET, | 859 OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET, |
860 "Single frame cannot fit into a packet", _)); | 860 "Single frame cannot fit into a packet", _)); |
861 EXPECT_QUIC_BUG(generator_.AddControlFrame(QuicFrame(frame)), ""); | 861 EXPECT_QUIC_BUG(generator_.AddControlFrame(QuicFrame(frame)), ""); |
862 EXPECT_TRUE(generator_.HasQueuedFrames()); | 862 EXPECT_TRUE(generator_.HasQueuedFrames()); |
863 } | 863 } |
864 | 864 |
865 } // namespace test | 865 } // namespace test |
866 } // namespace net | 866 } // namespace net |
OLD | NEW |