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.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
9 #include "net/quic/congestion_control/receive_algorithm_interface.h" | 9 #include "net/quic/congestion_control/receive_algorithm_interface.h" |
10 #include "net/quic/congestion_control/send_algorithm_interface.h" | 10 #include "net/quic/congestion_control/send_algorithm_interface.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
219 class QuicConnectionTest : public ::testing::Test { | 219 class QuicConnectionTest : public ::testing::Test { |
220 protected: | 220 protected: |
221 QuicConnectionTest() | 221 QuicConnectionTest() |
222 : guid_(42), | 222 : guid_(42), |
223 framer_(kQuicVersion1, | 223 framer_(kQuicVersion1, |
224 QuicDecrypter::Create(kNULL), | 224 QuicDecrypter::Create(kNULL), |
225 QuicEncrypter::Create(kNULL)), | 225 QuicEncrypter::Create(kNULL)), |
226 creator_(guid_, &framer_, QuicRandom::GetInstance()), | 226 creator_(guid_, &framer_, QuicRandom::GetInstance()), |
227 send_algorithm_(new StrictMock<MockSendAlgorithm>), | 227 send_algorithm_(new StrictMock<MockSendAlgorithm>), |
228 helper_(new TestConnectionHelper(&clock_, &random_generator_)), | 228 helper_(new TestConnectionHelper(&clock_, &random_generator_)), |
229 connection_(guid_, IPEndPoint(), helper_.get()), | 229 connection_(guid_, IPEndPoint(), helper_), |
230 frame1_(1, false, 0, data1), | 230 frame1_(1, false, 0, data1), |
231 frame2_(1, false, 3, data2), | 231 frame2_(1, false, 3, data2), |
232 accept_packet_(true) { | 232 accept_packet_(true) { |
233 connection_.set_visitor(&visitor_); | 233 connection_.set_visitor(&visitor_); |
234 connection_.SetSendAlgorithm(send_algorithm_); | 234 connection_.SetSendAlgorithm(send_algorithm_); |
235 // Simplify tests by not sending feedback unless specifically configured. | 235 // Simplify tests by not sending feedback unless specifically configured. |
236 SetFeedback(NULL); | 236 SetFeedback(NULL); |
237 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _)).WillRepeatedly(Return( | 237 EXPECT_CALL(*send_algorithm_, TimeUntilSend(_, _)).WillRepeatedly(Return( |
238 QuicTime::Delta::Zero())); | 238 QuicTime::Delta::Zero())); |
239 EXPECT_CALL(*receive_algorithm_, | 239 EXPECT_CALL(*receive_algorithm_, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
440 } | 440 } |
441 | 441 |
442 QuicGuid guid_; | 442 QuicGuid guid_; |
443 QuicFramer framer_; | 443 QuicFramer framer_; |
444 QuicPacketCreator creator_; | 444 QuicPacketCreator creator_; |
445 | 445 |
446 MockSendAlgorithm* send_algorithm_; | 446 MockSendAlgorithm* send_algorithm_; |
447 TestReceiveAlgorithm* receive_algorithm_; | 447 TestReceiveAlgorithm* receive_algorithm_; |
448 MockClock clock_; | 448 MockClock clock_; |
449 MockRandom random_generator_; | 449 MockRandom random_generator_; |
450 scoped_ptr<TestConnectionHelper> helper_; | 450 TestConnectionHelper* helper_; // owned by connection_ |
ramant (doing other things)
2013/03/14 17:08:04
overly nit: Consider capitalizing owned.
owned ->
| |
451 TestConnection connection_; | 451 TestConnection connection_; |
452 testing::StrictMock<MockConnectionVisitor> visitor_; | 452 testing::StrictMock<MockConnectionVisitor> visitor_; |
453 | 453 |
454 QuicPacketHeader header_; | 454 QuicPacketHeader header_; |
455 QuicPacketHeader revived_header_; | 455 QuicPacketHeader revived_header_; |
456 QuicStreamFrame frame1_; | 456 QuicStreamFrame frame1_; |
457 QuicStreamFrame frame2_; | 457 QuicStreamFrame frame2_; |
458 bool accept_packet_; | 458 bool accept_packet_; |
459 | 459 |
460 private: | 460 private: |
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1606 entropy_hash ^= packet_entropy_hash; | 1606 entropy_hash ^= packet_entropy_hash; |
1607 } | 1607 } |
1608 EXPECT_TRUE(QuicConnectionPeer::IsValidEntropy( | 1608 EXPECT_TRUE(QuicConnectionPeer::IsValidEntropy( |
1609 &connection_, max_sequence_number, missing_packets, entropy_hash)) | 1609 &connection_, max_sequence_number, missing_packets, entropy_hash)) |
1610 << ""; | 1610 << ""; |
1611 } | 1611 } |
1612 | 1612 |
1613 } // namespace | 1613 } // namespace |
1614 } // namespace test | 1614 } // namespace test |
1615 } // namespace net | 1615 } // namespace net |
OLD | NEW |