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

Side by Side Diff: net/quic/quic_packet_creator_test.cc

Issue 1658373002: Move QuicPacketCreator::SerializeAllFrames into QuicPacketCreatorPeer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0202
Patch Set: Created 4 years, 10 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/quic_packet_creator.cc ('k') | net/quic/test_tools/quic_packet_creator_peer.h » ('j') | 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/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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/test_tools/quic_packet_creator_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698