Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_connection_helper.h" | 5 #include "net/quic/quic_connection_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/quic/crypto/quic_decrypter.h" | 10 #include "net/quic/crypto/quic_decrypter.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 &random_generator_)); | 126 &random_generator_)); |
| 127 send_algorithm_ = new testing::StrictMock<MockSendAlgorithm>(); | 127 send_algorithm_ = new testing::StrictMock<MockSendAlgorithm>(); |
| 128 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _, _)). | 128 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _, _, _)). |
| 129 WillRepeatedly(Return(QuicTime::Delta::Zero())); | 129 WillRepeatedly(Return(QuicTime::Delta::Zero())); |
| 130 EXPECT_CALL(*send_algorithm_, BandwidthEstimate()).WillRepeatedly(Return( | 130 EXPECT_CALL(*send_algorithm_, BandwidthEstimate()).WillRepeatedly(Return( |
| 131 QuicBandwidth::FromKBitsPerSecond(100))); | 131 QuicBandwidth::FromKBitsPerSecond(100))); |
| 132 EXPECT_CALL(*send_algorithm_, SmoothedRtt()).WillRepeatedly(Return( | 132 EXPECT_CALL(*send_algorithm_, SmoothedRtt()).WillRepeatedly(Return( |
| 133 QuicTime::Delta::FromMilliseconds(100))); | 133 QuicTime::Delta::FromMilliseconds(100))); |
| 134 ON_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)) | 134 ON_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)) |
| 135 .WillByDefault(Return(true)); | 135 .WillByDefault(Return(true)); |
| 136 ON_CALL(*send_algorithm_, SetFromConfig(_, _)).WillByDefault(Return()); | |
|
Ryan Hamilton
2013/10/31 19:43:44
SetFromConfig is a void method, right? Can you do
ramant (doing other things)
2013/10/31 23:11:52
Done.
| |
| 136 EXPECT_CALL(visitor_, HasPendingHandshake()).Times(AnyNumber()); | 137 EXPECT_CALL(visitor_, HasPendingHandshake()).Times(AnyNumber()); |
| 137 writer_.reset(new QuicDefaultPacketWriter(socket_.get())); | 138 writer_.reset(new QuicDefaultPacketWriter(socket_.get())); |
| 138 connection_.reset(new TestConnection(guid_, IPEndPoint(), helper_.get(), | 139 connection_.reset(new TestConnection(guid_, IPEndPoint(), helper_.get(), |
| 139 writer_.get())); | 140 writer_.get())); |
| 140 connection_->set_visitor(&visitor_); | 141 connection_->set_visitor(&visitor_); |
| 141 connection_->SetSendAlgorithm(send_algorithm_); | 142 connection_->SetSendAlgorithm(send_algorithm_); |
| 142 } | 143 } |
| 143 | 144 |
| 144 // Returns a newly created packet to send kData on stream 1. | 145 // Returns a newly created packet to send kData on stream 1. |
| 145 QuicEncryptedPacket* ConstructDataPacket( | 146 QuicEncryptedPacket* ConstructDataPacket( |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 509 Return(QuicTime::Delta::Zero())); | 510 Return(QuicTime::Delta::Zero())); |
| 510 EXPECT_CALL(visitor_, OnCanWrite()).WillOnce(Return(true)); | 511 EXPECT_CALL(visitor_, OnCanWrite()).WillOnce(Return(true)); |
| 511 EXPECT_CALL(visitor_, HasPendingHandshake()).Times(AnyNumber()); | 512 EXPECT_CALL(visitor_, HasPendingHandshake()).Times(AnyNumber()); |
| 512 runner_->RunNextTask(); | 513 runner_->RunNextTask(); |
| 513 EXPECT_EQ(0u, connection_->NumQueuedPackets()); | 514 EXPECT_EQ(0u, connection_->NumQueuedPackets()); |
| 514 EXPECT_TRUE(AtEof()); | 515 EXPECT_TRUE(AtEof()); |
| 515 } | 516 } |
| 516 | 517 |
| 517 } // namespace test | 518 } // namespace test |
| 518 } // namespace net | 519 } // namespace net |
| OLD | NEW |