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

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

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_protocol.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 "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/crypto/null_encrypter.h" 8 #include "net/quic/crypto/null_encrypter.h"
9 #include "net/quic/crypto/quic_decrypter.h" 9 #include "net/quic/crypto/quic_decrypter.h"
10 #include "net/quic/crypto/quic_encrypter.h" 10 #include "net/quic/crypto/quic_encrypter.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 TEST_F(QuicPacketCreatorTest, CreateStreamFrameFinOnly) { 172 TEST_F(QuicPacketCreatorTest, CreateStreamFrameFinOnly) {
173 QuicFrame frame; 173 QuicFrame frame;
174 size_t consumed = creator_.CreateStreamFrame(1u, "", 0u, true, &frame); 174 size_t consumed = creator_.CreateStreamFrame(1u, "", 0u, true, &frame);
175 EXPECT_EQ(0u, consumed); 175 EXPECT_EQ(0u, consumed);
176 CheckStreamFrame(frame, 1u, std::string(), 0u, true); 176 CheckStreamFrame(frame, 1u, std::string(), 0u, true);
177 delete frame.stream_frame; 177 delete frame.stream_frame;
178 } 178 }
179 179
180 TEST_F(QuicPacketCreatorTest, SerializeVersionNegotiationPacket) { 180 TEST_F(QuicPacketCreatorTest, SerializeVersionNegotiationPacket) {
181 QuicPacketCreatorPeer::SetIsServer(&creator_, true); 181 QuicPacketCreatorPeer::SetIsServer(&creator_, true);
182 QuicVersionTagList versions; 182 QuicTagVector versions;
183 versions.push_back(kQuicVersion1); 183 versions.push_back(kQuicVersion1);
184 scoped_ptr<QuicEncryptedPacket> encrypted( 184 scoped_ptr<QuicEncryptedPacket> encrypted(
185 creator_.SerializeVersionNegotiationPacket(versions)); 185 creator_.SerializeVersionNegotiationPacket(versions));
186 186
187 { 187 {
188 InSequence s; 188 InSequence s;
189 EXPECT_CALL(framer_visitor_, OnPacket()); 189 EXPECT_CALL(framer_visitor_, OnPacket());
190 EXPECT_CALL(framer_visitor_, OnVersionNegotiationPacket(_)); 190 EXPECT_CALL(framer_visitor_, OnVersionNegotiationPacket(_));
191 } 191 }
192 client_framer_.ProcessPacket(*encrypted.get()); 192 client_framer_.ProcessPacket(*encrypted.get());
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 EXPECT_FALSE(creator_.HasPendingFrames()); 284 EXPECT_FALSE(creator_.HasPendingFrames());
285 EXPECT_EQ(max_plaintext_size - 285 EXPECT_EQ(max_plaintext_size -
286 GetPacketHeaderSize( 286 GetPacketHeaderSize(
287 QuicPacketCreatorPeer::SendVersionInPacket(&creator_)), 287 QuicPacketCreatorPeer::SendVersionInPacket(&creator_)),
288 creator_.BytesFree()); 288 creator_.BytesFree());
289 } 289 }
290 290
291 } // namespace 291 } // namespace
292 } // namespace test 292 } // namespace test
293 } // namespace net 293 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698