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

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

Issue 126283002: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed extra space Created 6 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 | Annotate | Revision Log
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 12 matching lines...) Expand all
23 : zero_time_(QuicTime::Delta::Zero()), 23 : zero_time_(QuicTime::Delta::Zero()),
24 infinite_time_(QuicTime::Delta::Infinite()), 24 infinite_time_(QuicTime::Delta::Infinite()),
25 sequence_number_(1), 25 sequence_number_(1),
26 mock_sender_(new StrictMock<MockSendAlgorithm>()), 26 mock_sender_(new StrictMock<MockSendAlgorithm>()),
27 pacing_sender_(new PacingSender(mock_sender_, 27 pacing_sender_(new PacingSender(mock_sender_,
28 QuicTime::Delta::FromMilliseconds(1))) { 28 QuicTime::Delta::FromMilliseconds(1))) {
29 // Pick arbitrary time. 29 // Pick arbitrary time.
30 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(9)); 30 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(9));
31 } 31 }
32 32
33 virtual ~PacingSenderTest() {} 33 virtual ~PacingSenderTest() OVERRIDE {}
34 34
35 void CheckPacketIsSentImmediately() { 35 void CheckPacketIsSentImmediately() {
36 // In order for the packet to be sendable, the underlying sender must 36 // In order for the packet to be sendable, the underlying sender must
37 // permit it to be sent immediately. 37 // permit it to be sent immediately.
38 EXPECT_CALL(*mock_sender_, TimeUntilSend(clock_.Now(), 38 EXPECT_CALL(*mock_sender_, TimeUntilSend(clock_.Now(),
39 NOT_RETRANSMISSION, 39 NOT_RETRANSMISSION,
40 HAS_RETRANSMITTABLE_DATA, 40 HAS_RETRANSMITTABLE_DATA,
41 NOT_HANDSHAKE)) 41 NOT_HANDSHAKE))
42 .WillOnce(Return(zero_time_)); 42 .WillOnce(Return(zero_time_));
43 // Verify that the packet can be sent immediately. 43 // Verify that the packet can be sent immediately.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2)); 159 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
160 160
161 // Wake up early, but after enough time has passed to permit a send. 161 // Wake up early, but after enough time has passed to permit a send.
162 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); 162 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
163 CheckPacketIsSentImmediately(); 163 CheckPacketIsSentImmediately();
164 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2)); 164 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
165 } 165 }
166 166
167 } // namespace test 167 } // namespace test
168 } // namespace net 168 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/pacing_sender.cc ('k') | net/quic/congestion_control/send_algorithm_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698