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/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 class TestConnection : public QuicConnection { | 400 class TestConnection : public QuicConnection { |
401 public: | 401 public: |
402 TestConnection(QuicConnectionId connection_id, | 402 TestConnection(QuicConnectionId connection_id, |
403 IPEndPoint address, | 403 IPEndPoint address, |
404 TestConnectionHelper* helper, | 404 TestConnectionHelper* helper, |
405 TestPacketWriter* writer, | 405 TestPacketWriter* writer, |
406 bool is_server, | 406 bool is_server, |
407 QuicVersion version) | 407 QuicVersion version) |
408 : QuicConnection(connection_id, address, helper, writer, is_server, | 408 : QuicConnection(connection_id, address, helper, writer, is_server, |
409 SupportedVersions(version)), | 409 SupportedVersions(version)), |
410 helper_(helper), | |
411 writer_(writer) { | 410 writer_(writer) { |
412 // Disable tail loss probes for most tests. | 411 // Disable tail loss probes for most tests. |
413 QuicSentPacketManagerPeer::SetMaxTailLossProbes( | 412 QuicSentPacketManagerPeer::SetMaxTailLossProbes( |
414 QuicConnectionPeer::GetSentPacketManager(this), 0); | 413 QuicConnectionPeer::GetSentPacketManager(this), 0); |
415 writer_->set_is_server(is_server); | 414 writer_->set_is_server(is_server); |
416 } | 415 } |
417 | 416 |
418 void SendAck() { | 417 void SendAck() { |
419 QuicConnectionPeer::SendAck(this); | 418 QuicConnectionPeer::SendAck(this); |
420 } | 419 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 } | 524 } |
526 | 525 |
527 TestConnectionHelper::TestAlarm* GetTimeoutAlarm() { | 526 TestConnectionHelper::TestAlarm* GetTimeoutAlarm() { |
528 return reinterpret_cast<TestConnectionHelper::TestAlarm*>( | 527 return reinterpret_cast<TestConnectionHelper::TestAlarm*>( |
529 QuicConnectionPeer::GetTimeoutAlarm(this)); | 528 QuicConnectionPeer::GetTimeoutAlarm(this)); |
530 } | 529 } |
531 | 530 |
532 using QuicConnection::SelectMutualVersion; | 531 using QuicConnection::SelectMutualVersion; |
533 | 532 |
534 private: | 533 private: |
535 TestConnectionHelper* helper_; | |
536 TestPacketWriter* writer_; | 534 TestPacketWriter* writer_; |
537 | 535 |
538 DISALLOW_COPY_AND_ASSIGN(TestConnection); | 536 DISALLOW_COPY_AND_ASSIGN(TestConnection); |
539 }; | 537 }; |
540 | 538 |
541 class QuicConnectionTest : public ::testing::TestWithParam<QuicVersion> { | 539 class QuicConnectionTest : public ::testing::TestWithParam<QuicVersion> { |
542 protected: | 540 protected: |
543 QuicConnectionTest() | 541 QuicConnectionTest() |
544 : connection_id_(42), | 542 : connection_id_(42), |
545 framer_(SupportedVersions(version()), QuicTime::Zero(), false), | 543 framer_(SupportedVersions(version()), QuicTime::Zero(), false), |
(...skipping 3284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3830 QuicBlockedFrame blocked; | 3828 QuicBlockedFrame blocked; |
3831 blocked.stream_id = 3; | 3829 blocked.stream_id = 3; |
3832 EXPECT_CALL(visitor_, OnBlockedFrames(_)); | 3830 EXPECT_CALL(visitor_, OnBlockedFrames(_)); |
3833 ProcessFramePacket(QuicFrame(&blocked)); | 3831 ProcessFramePacket(QuicFrame(&blocked)); |
3834 EXPECT_TRUE(ack_alarm->IsSet()); | 3832 EXPECT_TRUE(ack_alarm->IsSet()); |
3835 } | 3833 } |
3836 | 3834 |
3837 } // namespace | 3835 } // namespace |
3838 } // namespace test | 3836 } // namespace test |
3839 } // namespace net | 3837 } // namespace net |
OLD | NEW |