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

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

Issue 2848203002: Add a platform implementation of QuicTest and QuicTestWithParam (Closed)
Patch Set: net/quic/platform/impl/quic_test_impl.cc Created 3 years, 7 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
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/core/congestion_control/pacing_sender.h" 5 #include "net/quic/core/congestion_control/pacing_sender.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "net/quic/core/quic_packets.h" 9 #include "net/quic/core/quic_packets.h"
10 #include "net/quic/platform/api/quic_logging.h" 10 #include "net/quic/platform/api/quic_logging.h"
11 #include "net/quic/platform/api/quic_test.h"
11 #include "net/quic/test_tools/mock_clock.h" 12 #include "net/quic/test_tools/mock_clock.h"
12 #include "net/quic/test_tools/quic_test_utils.h" 13 #include "net/quic/test_tools/quic_test_utils.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 using testing::Return; 16 using testing::Return;
16 using testing::StrictMock; 17 using testing::StrictMock;
17 using testing::_; 18 using testing::_;
18 19
19 namespace net { 20 namespace net {
20 namespace test { 21 namespace test {
21 22
22 const QuicByteCount kBytesInFlight = 1024; 23 const QuicByteCount kBytesInFlight = 1024;
23 const int kInitialBurstPackets = 10; 24 const int kInitialBurstPackets = 10;
24 25
25 class PacingSenderTest : public ::testing::Test { 26 class PacingSenderTest : public QuicTest {
26 protected: 27 protected:
27 PacingSenderTest() 28 PacingSenderTest()
28 : zero_time_(QuicTime::Delta::Zero()), 29 : zero_time_(QuicTime::Delta::Zero()),
29 infinite_time_(QuicTime::Delta::Infinite()), 30 infinite_time_(QuicTime::Delta::Infinite()),
30 packet_number_(1), 31 packet_number_(1),
31 mock_sender_(new StrictMock<MockSendAlgorithm>()), 32 mock_sender_(new StrictMock<MockSendAlgorithm>()),
32 pacing_sender_(new PacingSender) { 33 pacing_sender_(new PacingSender) {
33 pacing_sender_->set_sender(mock_sender_.get()); 34 pacing_sender_->set_sender(mock_sender_.get());
34 // Pick arbitrary time. 35 // Pick arbitrary time.
35 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(9)); 36 clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(9));
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 UpdateRtt(); 344 UpdateRtt();
344 345
345 // Ensure only one packet is sent immediately and the rest are paced. 346 // Ensure only one packet is sent immediately and the rest are paced.
346 CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, true); 347 CheckPacketIsSentImmediately(HAS_RETRANSMITTABLE_DATA, 0, true);
347 CheckPacketIsSentImmediately(); 348 CheckPacketIsSentImmediately();
348 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2)); 349 CheckPacketIsDelayed(QuicTime::Delta::FromMilliseconds(2));
349 } 350 }
350 351
351 } // namespace test 352 } // namespace test
352 } // namespace net 353 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/congestion_control/hybrid_slow_start_test.cc ('k') | net/quic/core/congestion_control/prr_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698