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

Side by Side Diff: net/quic/congestion_control/pacing_sender_test.cc

Issue 928913002: Remove Test DISABLED_CongestionAvoidanceSending (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/congestion_control/pacing_sender.h" 5 #include "net/quic/congestion_control/pacing_sender.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "net/quic/quic_protocol.h" 9 #include "net/quic/quic_protocol.h"
10 #include "net/quic/test_tools/mock_clock.h" 10 #include "net/quic/test_tools/mock_clock.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 // Wake up too early. 188 // Wake up too early.
189 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2)); 189 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
190 190
191 // Wake up early, but after enough time has passed to permit a send. 191 // Wake up early, but after enough time has passed to permit a send.
192 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 192 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
193 CheckPacketIsSentImmediately(); 193 CheckPacketIsSentImmediately();
194 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2)); 194 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
195 } 195 }
196 196
197 // TODO(ianswett): Remove this test.
ramant (doing other things) 2015/02/17 18:52:53 Please don't remove this code. It is shared with t
asanka 2015/02/18 17:17:37 Can you summarize the current state of this test?
ramant (doing other things) 2015/02/23 21:53:07 Checked with Ian. He said this test can be removed
198 TEST_F(PacingSenderTest, DISABLED_CongestionAvoidanceSending) {
199 // Configure pacing rate of 1 packet per 1 ms.
200 EXPECT_CALL(*mock_sender_, PacingRate())
201 .WillRepeatedly(Return(QuicBandwidth::FromBytesAndTimeDelta(
202 kMaxPacketSize * 1.25, QuicTime::Delta::FromMilliseconds(2))));
203
204 // Now update the RTT and verify that packets are actually paced.
205 UpdateRtt();
206
207 CheckPacketIsSentImmediately();
208 CheckPacketIsSentImmediately();
209
210 // The first packet was a "make up", then we sent two packets "into the
211 // future", so the delay should be 2200us.
212 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(2200));
213
214 // Wake up on time.
215 clock_.AdvanceTime(QuicTime::Delta::FromMicroseconds(2200));
216 CheckPacketIsSentImmediately();
217 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(1600));
218 CheckAckIsSentImmediately();
219
220 // Wake up late.
221 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(4));
222 CheckPacketIsSentImmediately();
223 CheckPacketIsSentImmediately();
224 CheckPacketIsSentImmediately();
225 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(2400));
226
227 // Wake up really late.
228 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(8));
229 CheckPacketIsSentImmediately();
230 CheckPacketIsSentImmediately();
231 CheckPacketIsSentImmediately();
232 CheckPacketIsSentImmediately();
233 CheckPacketIsSentImmediately();
234 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(2400));
235
236 // Wake up really late again, but application pause partway through.
237 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(8));
238 CheckPacketIsSentImmediately();
239 CheckPacketIsSentImmediately();
240 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(100));
241 CheckPacketIsSentImmediately();
242 CheckPacketIsSentImmediately();
243 CheckPacketIsSentImmediately();
244 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(2200));
245
246 // Wake up too early.
247 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(2200));
248
249 // Wake up early, but after enough time has passed to permit a send.
250 clock_.AdvanceTime(QuicTime::Delta::FromMicroseconds(1200));
251 CheckPacketIsSentImmediately();
252 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(2600));
253 }
254
255 TEST_F(PacingSenderTest, InitialBurst) { 197 TEST_F(PacingSenderTest, InitialBurst) {
256 // Configure pacing rate of 1 packet per 1 ms. 198 // Configure pacing rate of 1 packet per 1 ms.
257 InitPacingRate(10, QuicBandwidth::FromBytesAndTimeDelta( 199 InitPacingRate(10, QuicBandwidth::FromBytesAndTimeDelta(
258 kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1))); 200 kMaxPacketSize, QuicTime::Delta::FromMilliseconds(1)));
259 201
260 // Update the RTT and verify that the first 10 packets aren't paced. 202 // Update the RTT and verify that the first 10 packets aren't paced.
261 UpdateRtt(); 203 UpdateRtt();
262 204
263 // Send 10 packets, and verify that they are not paced. 205 // Send 10 packets, and verify that they are not paced.
264 for (int i = 0 ; i < kInitialBurstPackets; ++i) { 206 for (int i = 0 ; i < kInitialBurstPackets; ++i) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 // The first packet was a "make up", then we sent two packets "into the 300 // The first packet was a "make up", then we sent two packets "into the
359 // future", so the delay should be 1.5ms. 301 // future", so the delay should be 1.5ms.
360 CheckPacketIsSentImmediately(); 302 CheckPacketIsSentImmediately();
361 CheckPacketIsSentImmediately(); 303 CheckPacketIsSentImmediately();
362 CheckPacketIsSentImmediately(); 304 CheckPacketIsSentImmediately();
363 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(1500)); 305 CheckPacketIsDelayed(QuicTime::Delta::FromMicroseconds(1500));
364 } 306 }
365 307
366 } // namespace test 308 } // namespace test
367 } // namespace net 309 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698