| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/tools/quic/quic_time_wait_list_manager.h" | 5 #include "net/tools/quic/quic_time_wait_list_manager.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include "net/quic/crypto/crypto_protocol.h" | 9 #include "net/quic/crypto/crypto_protocol.h" |
| 10 #include "net/quic/crypto/null_encrypter.h" | 10 #include "net/quic/crypto/null_encrypter.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 namespace { | 60 namespace { |
| 61 | 61 |
| 62 class MockFakeTimeEpollServer : public FakeTimeEpollServer { | 62 class MockFakeTimeEpollServer : public FakeTimeEpollServer { |
| 63 public: | 63 public: |
| 64 MOCK_METHOD2(RegisterAlarm, void(int64 timeout_in_us, | 64 MOCK_METHOD2(RegisterAlarm, void(int64 timeout_in_us, |
| 65 EpollAlarmCallbackInterface* alarm)); | 65 EpollAlarmCallbackInterface* alarm)); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 class QuicTimeWaitListManagerTest : public testing::Test { | 68 class QuicTimeWaitListManagerTest : public ::testing::Test { |
| 69 protected: | 69 protected: |
| 70 QuicTimeWaitListManagerTest() | 70 QuicTimeWaitListManagerTest() |
| 71 : time_wait_list_manager_(&writer_, &visitor_, | 71 : time_wait_list_manager_(&writer_, &visitor_, |
| 72 &epoll_server_, QuicSupportedVersions()), | 72 &epoll_server_, QuicSupportedVersions()), |
| 73 framer_(QuicSupportedVersions(), QuicTime::Zero(), true), | 73 framer_(QuicSupportedVersions(), QuicTime::Zero(), true), |
| 74 connection_id_(45), | 74 connection_id_(45), |
| 75 client_address_(net::test::TestPeerIPAddress(), kTestPort), | 75 client_address_(net::test::TestPeerIPAddress(), kTestPort), |
| 76 writer_is_blocked_(false) {} | 76 writer_is_blocked_(false) {} |
| 77 | 77 |
| 78 virtual ~QuicTimeWaitListManagerTest() {} | 78 virtual ~QuicTimeWaitListManagerTest() {} |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 EXPECT_CALL(epoll_server_, RegisterAlarm(_, _)); | 429 EXPECT_CALL(epoll_server_, RegisterAlarm(_, _)); |
| 430 | 430 |
| 431 time_wait_list_manager_.CleanUpOldConnectionIds(); | 431 time_wait_list_manager_.CleanUpOldConnectionIds(); |
| 432 EXPECT_FALSE(IsConnectionIdInTimeWait(kConnectionId1)); | 432 EXPECT_FALSE(IsConnectionIdInTimeWait(kConnectionId1)); |
| 433 EXPECT_TRUE(IsConnectionIdInTimeWait(kConnectionId2)); | 433 EXPECT_TRUE(IsConnectionIdInTimeWait(kConnectionId2)); |
| 434 } | 434 } |
| 435 } // namespace | 435 } // namespace |
| 436 } // namespace test | 436 } // namespace test |
| 437 } // namespace tools | 437 } // namespace tools |
| 438 } // namespace net | 438 } // namespace net |
| OLD | NEW |