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

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

Issue 789103013: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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_connection.cc ('k') | net/quic/quic_flags.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_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 3160 matching lines...) Expand 10 before | Expand all | Expand 10 after
3171 // Queue the first packet. 3171 // Queue the first packet.
3172 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(7); 3172 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(7);
3173 // The first stream frame will have 2 fewer overhead bytes than the other six. 3173 // The first stream frame will have 2 fewer overhead bytes than the other six.
3174 const string payload(payload_length * 7 + 2, 'a'); 3174 const string payload(payload_length * 7 + 2, 'a');
3175 EXPECT_EQ(payload.size(), 3175 EXPECT_EQ(payload.size(),
3176 connection_.SendStreamDataWithString(1, payload, 0, !kFin, nullptr) 3176 connection_.SendStreamDataWithString(1, payload, 0, !kFin, nullptr)
3177 .bytes_consumed); 3177 .bytes_consumed);
3178 } 3178 }
3179 3179
3180 TEST_P(QuicConnectionTest, LoopThroughSendingPacketsWithTruncation) { 3180 TEST_P(QuicConnectionTest, LoopThroughSendingPacketsWithTruncation) {
3181 ValueRestore<bool> old_flag(&FLAGS_allow_truncated_connection_ids_for_quic,
3182 true);
3183
3184 // Set up a larger payload than will fit in one packet. 3181 // Set up a larger payload than will fit in one packet.
3185 const string payload(connection_.max_packet_length(), 'a'); 3182 const string payload(connection_.max_packet_length(), 'a');
3186 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _)).Times(AnyNumber()); 3183 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _)).Times(AnyNumber());
3187 3184
3188 // Now send some packets with no truncation. 3185 // Now send some packets with no truncation.
3189 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2); 3186 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
3190 EXPECT_EQ(payload.size(), 3187 EXPECT_EQ(payload.size(),
3191 connection_.SendStreamDataWithString( 3188 connection_.SendStreamDataWithString(
3192 3, payload, 0, !kFin, nullptr).bytes_consumed); 3189 3, payload, 0, !kFin, nullptr).bytes_consumed);
3193 // Track the size of the second packet here. The overhead will be the largest 3190 // Track the size of the second packet here. The overhead will be the largest
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
4338 // Regression test for b/18594622 4335 // Regression test for b/18594622
4339 scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate); 4336 scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate);
4340 EXPECT_DFATAL( 4337 EXPECT_DFATAL(
4341 connection_.SendStreamDataWithString(3, "", 0, !kFin, delegate.get()), 4338 connection_.SendStreamDataWithString(3, "", 0, !kFin, delegate.get()),
4342 "Attempt to send empty stream frame"); 4339 "Attempt to send empty stream frame");
4343 } 4340 }
4344 4341
4345 } // namespace 4342 } // namespace
4346 } // namespace test 4343 } // namespace test
4347 } // namespace net 4344 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698