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

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

Issue 19858003: * Removed QuicTag kQuicVersion1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comments from rch Created 7 years, 5 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_packet_generator_test.cc » ('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 12 matching lines...) Expand all
23 using testing::SaveArg; 23 using testing::SaveArg;
24 using testing::_; 24 using testing::_;
25 25
26 namespace net { 26 namespace net {
27 namespace test { 27 namespace test {
28 namespace { 28 namespace {
29 29
30 class QuicPacketCreatorTest : public ::testing::TestWithParam<bool> { 30 class QuicPacketCreatorTest : public ::testing::TestWithParam<bool> {
31 protected: 31 protected:
32 QuicPacketCreatorTest() 32 QuicPacketCreatorTest()
33 : server_framer_(kQuicVersion1, QuicTime::Zero(), true), 33 : server_framer_(QuicVersionMax(), QuicTime::Zero(), true),
34 client_framer_(kQuicVersion1, QuicTime::Zero(), false), 34 client_framer_(QuicVersionMax(), QuicTime::Zero(), false),
35 id_(1), 35 id_(1),
36 sequence_number_(0), 36 sequence_number_(0),
37 guid_(2), 37 guid_(2),
38 data_("foo"), 38 data_("foo"),
39 creator_(guid_, &client_framer_, QuicRandom::GetInstance(), false) { 39 creator_(guid_, &client_framer_, QuicRandom::GetInstance(), false) {
40 client_framer_.set_visitor(&framer_visitor_); 40 client_framer_.set_visitor(&framer_visitor_);
41 server_framer_.set_visitor(&framer_visitor_); 41 server_framer_.set_visitor(&framer_visitor_);
42 } 42 }
43 ~QuicPacketCreatorTest() { 43 ~QuicPacketCreatorTest() {
44 } 44 }
(...skipping 127 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, string(), 0u, true); 176 CheckStreamFrame(frame, 1u, 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 QuicTagVector versions; 182 QuicVersionVector versions;
183 versions.push_back(kQuicVersion1); 183 versions.push_back(QuicVersionMax());
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());
193 } 193 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 creator_.options()->send_guid_length, 294 creator_.options()->send_guid_length,
295 QuicPacketCreatorPeer::SendVersionInPacket(&creator_), 295 QuicPacketCreatorPeer::SendVersionInPacket(&creator_),
296 PACKET_6BYTE_SEQUENCE_NUMBER, 296 PACKET_6BYTE_SEQUENCE_NUMBER,
297 NOT_IN_FEC_GROUP), 297 NOT_IN_FEC_GROUP),
298 creator_.BytesFree()); 298 creator_.BytesFree());
299 } 299 }
300 300
301 } // namespace 301 } // namespace
302 } // namespace test 302 } // namespace test
303 } // namespace net 303 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698