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

Side by Side Diff: net/quic/core/quic_sent_packet_manager_test.cc

Issue 2306173003: Add a new QuicFlagSaver class for saving/restoring the values of QUIC flags in tests. (Closed)
Patch Set: Better Created 4 years, 3 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/core/quic_protocol_test.cc ('k') | net/quic/core/quic_server_session_base_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/core/quic_sent_packet_manager.h" 5 #include "net/quic/core/quic_sent_packet_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/quic/core/quic_flags.h" 10 #include "net/quic/core/quic_flags.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 void NackPackets(QuicPacketNumber lower, 296 void NackPackets(QuicPacketNumber lower,
297 QuicPacketNumber higher, 297 QuicPacketNumber higher,
298 QuicAckFrame* frame) { 298 QuicAckFrame* frame) {
299 if (frame->missing) { 299 if (frame->missing) {
300 frame->packets.Add(lower, higher); 300 frame->packets.Add(lower, higher);
301 } else { 301 } else {
302 frame->packets.Remove(lower, higher); 302 frame->packets.Remove(lower, higher);
303 } 303 }
304 } 304 }
305 305
306 QuicFlagSaver flags_; // Save/restore all QUIC flag values.
306 QuicSentPacketManager manager_; 307 QuicSentPacketManager manager_;
307 vector<QuicEncryptedPacket*> packets_; 308 vector<QuicEncryptedPacket*> packets_;
308 MockClock clock_; 309 MockClock clock_;
309 QuicConnectionStats stats_; 310 QuicConnectionStats stats_;
310 MockSendAlgorithm* send_algorithm_; 311 MockSendAlgorithm* send_algorithm_;
311 std::unique_ptr<MockNetworkChangeVisitor> network_change_visitor_; 312 std::unique_ptr<MockNetworkChangeVisitor> network_change_visitor_;
312 }; 313 };
313 314
314 INSTANTIATE_TEST_CASE_P(QuicSentPacketManagerTest, 315 INSTANTIATE_TEST_CASE_P(QuicSentPacketManagerTest,
315 QuicSentPacketManagerTest, 316 QuicSentPacketManagerTest,
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 ExpectAck(1); 1708 ExpectAck(1);
1708 EXPECT_CALL(*network_change_visitor_, 1709 EXPECT_CALL(*network_change_visitor_,
1709 OnPathMtuIncreased(kDefaultLength + 100)); 1710 OnPathMtuIncreased(kDefaultLength + 100));
1710 QuicAckFrame ack_frame = InitAckFrame(1); 1711 QuicAckFrame ack_frame = InitAckFrame(1);
1711 manager_.OnIncomingAck(ack_frame, clock_.Now()); 1712 manager_.OnIncomingAck(ack_frame, clock_.Now());
1712 } 1713 }
1713 1714
1714 } // namespace 1715 } // namespace
1715 } // namespace test 1716 } // namespace test
1716 } // namespace net 1717 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_protocol_test.cc ('k') | net/quic/core/quic_server_session_base_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698