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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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_http_stream_test.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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 size_t consumed = creator_.CreateStreamFrame(1u, "test", 10u, true, &frame); 173 size_t consumed = creator_.CreateStreamFrame(1u, "test", 10u, true, &frame);
174 EXPECT_EQ(4u, consumed); 174 EXPECT_EQ(4u, consumed);
175 CheckStreamFrame(frame, 1u, "test", 10u, true); 175 CheckStreamFrame(frame, 1u, "test", 10u, true);
176 delete frame.stream_frame; 176 delete frame.stream_frame;
177 } 177 }
178 178
179 TEST_F(QuicPacketCreatorTest, CreateStreamFrameFinOnly) { 179 TEST_F(QuicPacketCreatorTest, CreateStreamFrameFinOnly) {
180 QuicFrame frame; 180 QuicFrame frame;
181 size_t consumed = creator_.CreateStreamFrame(1u, "", 0u, true, &frame); 181 size_t consumed = creator_.CreateStreamFrame(1u, "", 0u, true, &frame);
182 EXPECT_EQ(0u, consumed); 182 EXPECT_EQ(0u, consumed);
183 CheckStreamFrame(frame, 1u, "", 0u, true); 183 CheckStreamFrame(frame, 1u, std::string(), 0u, true);
184 delete frame.stream_frame; 184 delete frame.stream_frame;
185 } 185 }
186 186
187 TEST_F(QuicPacketCreatorTest, SerializeVersionNegotiationPacket) { 187 TEST_F(QuicPacketCreatorTest, SerializeVersionNegotiationPacket) {
188 QuicPacketCreatorPeer::SetIsServer(&creator_, true); 188 QuicPacketCreatorPeer::SetIsServer(&creator_, true);
189 QuicVersionTagList versions; 189 QuicVersionTagList versions;
190 versions.push_back(kQuicVersion1); 190 versions.push_back(kQuicVersion1);
191 scoped_ptr<QuicEncryptedPacket> encrypted( 191 scoped_ptr<QuicEncryptedPacket> encrypted(
192 creator_.SerializeVersionNegotiationPacket(versions)); 192 creator_.SerializeVersionNegotiationPacket(versions));
193 193
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 EXPECT_FALSE(creator_.HasPendingFrames()); 290 EXPECT_FALSE(creator_.HasPendingFrames());
291 EXPECT_EQ(max_plaintext_size - 291 EXPECT_EQ(max_plaintext_size -
292 GetPacketHeaderSize( 292 GetPacketHeaderSize(
293 QuicPacketCreatorPeer::SendVersionInPacket(&creator_)), 293 QuicPacketCreatorPeer::SendVersionInPacket(&creator_)),
294 creator_.BytesFree()); 294 creator_.BytesFree());
295 } 295 }
296 296
297 } // namespace 297 } // namespace
298 } // namespace test 298 } // namespace test
299 } // namespace net 299 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_http_stream_test.cc ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698