| 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/quic_packet_generator.h" | 5 #include "net/quic/quic_packet_generator.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "net/quic/crypto/crypto_protocol.h" | 9 #include "net/quic/crypto/crypto_protocol.h" |
| 10 #include "net/quic/crypto/null_encrypter.h" | 10 #include "net/quic/crypto/null_encrypter.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 frame->type = kFixRate; | 113 frame->type = kFixRate; |
| 114 frame->fix_rate.bitrate = QuicBandwidth::FromBytesPerSecond(42); | 114 frame->fix_rate.bitrate = QuicBandwidth::FromBytesPerSecond(42); |
| 115 return frame; | 115 return frame; |
| 116 } | 116 } |
| 117 | 117 |
| 118 QuicRstStreamFrame* CreateRstStreamFrame() { | 118 QuicRstStreamFrame* CreateRstStreamFrame() { |
| 119 return new QuicRstStreamFrame(1, QUIC_STREAM_NO_ERROR); | 119 return new QuicRstStreamFrame(1, QUIC_STREAM_NO_ERROR); |
| 120 } | 120 } |
| 121 | 121 |
| 122 QuicGoAwayFrame* CreateGoAwayFrame() { | 122 QuicGoAwayFrame* CreateGoAwayFrame() { |
| 123 return new QuicGoAwayFrame(QUIC_NO_ERROR, 1, ""); | 123 return new QuicGoAwayFrame(QUIC_NO_ERROR, 1, std::string()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void CheckPacketContains(const PacketContents& contents, | 126 void CheckPacketContains(const PacketContents& contents, |
| 127 const SerializedPacket& packet) { | 127 const SerializedPacket& packet) { |
| 128 size_t num_retransmittable_frames = contents.num_connection_close_frames + | 128 size_t num_retransmittable_frames = contents.num_connection_close_frames + |
| 129 contents.num_goaway_frames + contents.num_rst_stream_frames + | 129 contents.num_goaway_frames + contents.num_rst_stream_frames + |
| 130 contents.num_stream_frames; | 130 contents.num_stream_frames; |
| 131 size_t num_frames = contents.num_feedback_frames + contents.num_ack_frames + | 131 size_t num_frames = contents.num_feedback_frames + contents.num_ack_frames + |
| 132 num_retransmittable_frames; | 132 num_retransmittable_frames; |
| 133 | 133 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 505 |
| 506 // The second should have the remainder of the stream data. | 506 // The second should have the remainder of the stream data. |
| 507 PacketContents contents2; | 507 PacketContents contents2; |
| 508 contents2.num_goaway_frames = 1; | 508 contents2.num_goaway_frames = 1; |
| 509 contents2.num_stream_frames = 1; | 509 contents2.num_stream_frames = 1; |
| 510 CheckPacketContains(contents2, packet2_); | 510 CheckPacketContains(contents2, packet2_); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } // namespace test | 513 } // namespace test |
| 514 } // namespace net | 514 } // namespace net |
| OLD | NEW |