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

Unified Diff: net/quic/quic_connection_test.cc

Issue 11961022: Remove default constructors for QuicTime and QuicTime::Delta and used static Zero() methods instead… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_connection_test.cc
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index 038ddeaa0d7f92f7ec7924b5ebd3f329abdf376f..4028ff15079ee34cffc77f7bb45dac3abee3d575 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -64,6 +64,9 @@ class TestConnectionHelper : public QuicConnectionHelperInterface {
TestConnectionHelper(MockClock* clock, MockRandom* random_generator)
: clock_(clock),
random_generator_(random_generator),
+ retransmission_alarm_(QuicTime::Zero()),
+ send_alarm_(QuicTime::Zero()),
+ timeout_alarm_(QuicTime::Zero()),
blocked_(false) {
}
@@ -117,7 +120,7 @@ class TestConnectionHelper : public QuicConnectionHelperInterface {
}
virtual void UnregisterSendAlarmIfRegistered() {
- send_alarm_ = QuicTime();
+ send_alarm_ = QuicTime::Zero();
}
virtual void SetAckAlarm(QuicTime::Delta delay) {}
@@ -201,7 +204,7 @@ class QuicConnectionTest : public ::testing::Test {
// Simplify tests by not sending feedback unless specifically configured.
SetFeedback(NULL);
EXPECT_CALL(*scheduler_, TimeUntilSend(_)).WillRepeatedly(Return(
- QuicTime::Delta()));
+ QuicTime::Delta::Zero()));
EXPECT_CALL(*collector_,
RecordIncomingPacket(_, _, _, _)).Times(AnyNumber());
EXPECT_CALL(*scheduler_, SentPacket(_, _, _)).Times(AnyNumber());
@@ -902,7 +905,7 @@ TEST_F(QuicConnectionTest, SendScheduler) {
// Test that if we send a packet without delay, it is not queued.
QuicPacket* packet = ConstructDataPacket(1, 0);
EXPECT_CALL(*scheduler_, TimeUntilSend(false)).WillOnce(testing::Return(
- QuicTime::Delta()));
+ QuicTime::Delta::Zero()));
EXPECT_CALL(*scheduler_, SentPacket(_, _, _));
connection_.SendPacket(1, packet, true, false, false);
EXPECT_EQ(0u, connection_.NumQueuedPackets());
@@ -932,7 +935,7 @@ TEST_F(QuicConnectionTest, DISABLED_SendSchedulerEAGAIN) {
QuicPacket* packet = ConstructDataPacket(1, 0);
helper_->set_blocked(true);
EXPECT_CALL(*scheduler_, TimeUntilSend(false)).WillOnce(testing::Return(
- QuicTime::Delta()));
+ QuicTime::Delta::Zero()));
EXPECT_CALL(*scheduler_, SentPacket(1, _, _)).Times(0);
connection_.SendPacket(1, packet, true, false, false);
EXPECT_EQ(1u, connection_.NumQueuedPackets());
@@ -949,7 +952,7 @@ TEST_F(QuicConnectionTest, SendSchedulerDelayThenSend) {
// Advance the clock to fire the alarm, and configure the scheduler
// to permit the packet to be sent.
EXPECT_CALL(*scheduler_, TimeUntilSend(false)).WillOnce(testing::Return(
- QuicTime::Delta()));
+ QuicTime::Delta::Zero()));
clock_.AdvanceTime(QuicTime::Delta::FromMicroseconds(1));
EXPECT_CALL(*scheduler_, SentPacket(_, _, _));
EXPECT_CALL(visitor_, OnCanWrite());
@@ -968,7 +971,7 @@ TEST_F(QuicConnectionTest, SendSchedulerDelayThenRetransmit) {
// Advance the clock to fire the alarm, and configure the scheduler
// to permit the packet to be sent.
EXPECT_CALL(*scheduler_, TimeUntilSend(true)).WillOnce(testing::Return(
- QuicTime::Delta()));
+ QuicTime::Delta::Zero()));
// Ensure the scheduler is notified this is a retransmit.
EXPECT_CALL(*scheduler_, SentPacket(1, _, true));
@@ -1002,7 +1005,7 @@ TEST_F(QuicConnectionTest, SendSchedulerDelayThenAckAndSend) {
// retransmit 3. The far end should stop waiting for it.
QuicAckFrame frame(0, 1);
EXPECT_CALL(*scheduler_, TimeUntilSend(false)).WillRepeatedly(testing::Return(
- QuicTime::Delta()));
+ QuicTime::Delta::Zero()));
EXPECT_CALL(*scheduler_, SentPacket(_, _, _));
EXPECT_CALL(visitor_, OnCanWrite());
ProcessAckPacket(&frame);

Powered by Google App Engine
This is Rietveld 408576698