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

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

Issue 1807033002: Don't copy the QuicAckFrame into the QuicPacketGenerator. Protected by quic_dont_copy_acks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116794514
Patch Set: Created 4 years, 9 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_flags.cc ('k') | net/quic/quic_packet_generator.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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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_multipath_received_packet_manager.h" 5 #include "net/quic/quic_multipath_received_packet_manager.h"
6 6
7 #include "net/quic/quic_connection_stats.h" 7 #include "net/quic/quic_connection_stats.h"
8 #include "net/quic/quic_flags.h"
8 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
9 #include "net/test/gtest_util.h" 10 #include "net/test/gtest_util.h"
10 #include "testing/gmock/include/gmock/gmock.h" 11 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 using testing::Return; 14 using testing::Return;
14 using testing::_; 15 using testing::_;
15 16
16 namespace net { 17 namespace net {
17 namespace test { 18 namespace test {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 EXPECT_TRUE(multipath_manager_.IsAwaitingPacket(kDefaultPathId, 121 EXPECT_TRUE(multipath_manager_.IsAwaitingPacket(kDefaultPathId,
121 header_.packet_number)); 122 header_.packet_number));
122 EXPECT_FALSE( 123 EXPECT_FALSE(
123 multipath_manager_.IsAwaitingPacket(kPathId1, header_.packet_number)); 124 multipath_manager_.IsAwaitingPacket(kPathId1, header_.packet_number));
124 EXPECT_DFATAL( 125 EXPECT_DFATAL(
125 multipath_manager_.IsAwaitingPacket(kPathId2, header_.packet_number), 126 multipath_manager_.IsAwaitingPacket(kPathId2, header_.packet_number),
126 "Check whether a packet is awaited on a non-existent path"); 127 "Check whether a packet is awaited on a non-existent path");
127 } 128 }
128 129
129 TEST_F(QuicMultipathReceivedPacketManagerTest, UpdateReceivedPacketInfo) { 130 TEST_F(QuicMultipathReceivedPacketManagerTest, UpdateReceivedPacketInfo) {
131 FLAGS_quic_dont_copy_acks = false;
130 std::vector<QuicAckFrame> ack_frames; 132 std::vector<QuicAckFrame> ack_frames;
131 EXPECT_EQ(static_cast<size_t>(0), ack_frames.size()); 133 EXPECT_EQ(static_cast<size_t>(0), ack_frames.size());
132 EXPECT_CALL(*manager_0_, ack_frame_updated()).WillOnce(Return(false)); 134 EXPECT_CALL(*manager_0_, ack_frame_updated()).WillOnce(Return(false));
133 EXPECT_CALL(*manager_1_, ack_frame_updated()).WillRepeatedly(Return(false)); 135 EXPECT_CALL(*manager_1_, ack_frame_updated()).WillRepeatedly(Return(false));
134 multipath_manager_.UpdateReceivedPacketInfo(&ack_frames, QuicTime::Zero(), 136 multipath_manager_.UpdateReceivedPacketInfo(&ack_frames, QuicTime::Zero(),
135 /*force_all_paths=*/false); 137 /*force_all_paths=*/false);
136 EXPECT_EQ(static_cast<size_t>(0), ack_frames.size()); 138 EXPECT_EQ(static_cast<size_t>(0), ack_frames.size());
137 EXPECT_CALL(*manager_0_, ack_frame_updated()).WillOnce(Return(true)); 139 EXPECT_CALL(*manager_0_, ack_frame_updated()).WillOnce(Return(true));
138 multipath_manager_.UpdateReceivedPacketInfo(&ack_frames, QuicTime::Zero(), 140 multipath_manager_.UpdateReceivedPacketInfo(&ack_frames, QuicTime::Zero(),
139 /*force_all_paths=*/false); 141 /*force_all_paths=*/false);
(...skipping 27 matching lines...) Expand all
167 EXPECT_CALL(*manager_1_, HasNewMissingPackets()).WillOnce(Return(false)); 169 EXPECT_CALL(*manager_1_, HasNewMissingPackets()).WillOnce(Return(false));
168 EXPECT_TRUE(multipath_manager_.HasNewMissingPackets(kDefaultPathId)); 170 EXPECT_TRUE(multipath_manager_.HasNewMissingPackets(kDefaultPathId));
169 EXPECT_FALSE(multipath_manager_.HasNewMissingPackets(kPathId1)); 171 EXPECT_FALSE(multipath_manager_.HasNewMissingPackets(kPathId1));
170 EXPECT_DFATAL(multipath_manager_.HasNewMissingPackets(kPathId2), 172 EXPECT_DFATAL(multipath_manager_.HasNewMissingPackets(kPathId2),
171 "Check whether has new missing packets on a non-existent path"); 173 "Check whether has new missing packets on a non-existent path");
172 } 174 }
173 175
174 } // namespace 176 } // namespace
175 } // namespace test 177 } // namespace test
176 } // namespace net 178 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_flags.cc ('k') | net/quic/quic_packet_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698