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_creator.h" | 5 #include "net/quic/quic_packet_creator.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 client_framer_.set_received_entropy_calculator(&entropy_calculator_); | 133 client_framer_.set_received_entropy_calculator(&entropy_calculator_); |
134 server_framer_.set_visitor(&framer_visitor_); | 134 server_framer_.set_visitor(&framer_visitor_); |
135 // TODO(ianswett): Fix this test so it uses a non-null encrypter. | 135 // TODO(ianswett): Fix this test so it uses a non-null encrypter. |
136 FLAGS_quic_never_write_unencrypted_data = false; | 136 FLAGS_quic_never_write_unencrypted_data = false; |
137 FLAGS_quic_no_unencrypted_fec = false; | 137 FLAGS_quic_no_unencrypted_fec = false; |
138 } | 138 } |
139 | 139 |
140 ~QuicPacketCreatorTest() override {} | 140 ~QuicPacketCreatorTest() override {} |
141 | 141 |
142 SerializedPacket SerializeAllFrames(const QuicFrames& frames) { | 142 SerializedPacket SerializeAllFrames(const QuicFrames& frames) { |
143 SerializedPacket packet = | 143 SerializedPacket packet = QuicPacketCreatorPeer::SerializeAllFrames( |
144 creator_.SerializeAllFrames(frames, buffer_, kMaxPacketSize); | 144 &creator_, frames, buffer_, kMaxPacketSize); |
145 EXPECT_EQ(QuicPacketCreatorPeer::GetEncryptionLevel(&creator_), | 145 EXPECT_EQ(QuicPacketCreatorPeer::GetEncryptionLevel(&creator_), |
146 packet.encryption_level); | 146 packet.encryption_level); |
147 return packet; | 147 return packet; |
148 } | 148 } |
149 | 149 |
150 void ProcessPacket(QuicEncryptedPacket* encrypted) { | 150 void ProcessPacket(QuicEncryptedPacket* encrypted) { |
151 server_framer_.ProcessPacket(*encrypted); | 151 server_framer_.ProcessPacket(*encrypted); |
152 } | 152 } |
153 | 153 |
154 void CheckStreamFrame(const QuicFrame& frame, | 154 void CheckStreamFrame(const QuicFrame& frame, |
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 EXPECT_CALL(delegate_, CloseConnection(QUIC_UNENCRYPTED_FEC_DATA, _)); | 1693 EXPECT_CALL(delegate_, CloseConnection(QUIC_UNENCRYPTED_FEC_DATA, _)); |
1694 char seralized_fec_buffer[kMaxPacketSize]; | 1694 char seralized_fec_buffer[kMaxPacketSize]; |
1695 EXPECT_DFATAL(QuicPacketCreatorPeer::SerializeFec( | 1695 EXPECT_DFATAL(QuicPacketCreatorPeer::SerializeFec( |
1696 &creator_, seralized_fec_buffer, kMaxPacketSize), | 1696 &creator_, seralized_fec_buffer, kMaxPacketSize), |
1697 "SerializeFEC must be called with encryption."); | 1697 "SerializeFEC must be called with encryption."); |
1698 } | 1698 } |
1699 | 1699 |
1700 } // namespace | 1700 } // namespace |
1701 } // namespace test | 1701 } // namespace test |
1702 } // namespace net | 1702 } // namespace net |
OLD | NEW |