| 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/tools/quic/test_tools/quic_test_utils.h" | 5 #include "net/tools/quic/test_tools/quic_test_utils.h" |
| 6 | 6 |
| 7 #include "net/quic/test_tools/quic_test_utils.h" | 7 #include "net/quic/test_tools/quic_test_utils.h" |
| 8 #include "net/tools/quic/quic_epoll_connection_helper.h" | 8 #include "net/tools/quic/quic_epoll_connection_helper.h" |
| 9 | 9 |
| 10 using base::StringPiece; | 10 using base::StringPiece; |
| 11 using net::test::MockHelper; | 11 using net::test::MockHelper; |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 namespace tools { | 14 namespace tools { |
| 15 namespace test { | 15 namespace test { |
| 16 | 16 |
| 17 MockConnection::MockConnection(QuicGuid guid, | 17 MockConnection::MockConnection(QuicGuid guid, |
| 18 IPEndPoint address, | 18 IPEndPoint address, |
| 19 int fd, | 19 int fd, |
| 20 EpollServer* eps, | 20 EpollServer* eps, |
| 21 bool is_server) | 21 bool is_server) |
| 22 : QuicConnection(guid, address, | 22 : QuicConnection(guid, address, |
| 23 new QuicEpollConnectionHelper(fd, eps), is_server), | 23 new QuicEpollConnectionHelper(fd, eps), is_server, |
| 24 QuicVersionMax()), |
| 24 has_mock_helper_(false) { | 25 has_mock_helper_(false) { |
| 25 } | 26 } |
| 26 | 27 |
| 27 MockConnection::MockConnection(QuicGuid guid, | 28 MockConnection::MockConnection(QuicGuid guid, |
| 28 IPEndPoint address, | 29 IPEndPoint address, |
| 29 bool is_server) | 30 bool is_server) |
| 30 : QuicConnection(guid, address, new testing::NiceMock<MockHelper>(), | 31 : QuicConnection(guid, address, new testing::NiceMock<MockHelper>(), |
| 31 is_server), | 32 is_server, QuicVersionMax()), |
| 32 has_mock_helper_(true) { | 33 has_mock_helper_(true) { |
| 33 } | 34 } |
| 34 | 35 |
| 35 MockConnection::MockConnection(QuicGuid guid, | 36 MockConnection::MockConnection(QuicGuid guid, |
| 36 IPEndPoint address, | 37 IPEndPoint address, |
| 37 QuicConnectionHelperInterface* helper, | 38 QuicConnectionHelperInterface* helper, |
| 38 bool is_server) | 39 bool is_server) |
| 39 : QuicConnection(guid, address, helper, is_server), | 40 : QuicConnection(guid, address, helper, is_server, QuicVersionMax()), |
| 40 has_mock_helper_(false) { | 41 has_mock_helper_(false) { |
| 41 } | 42 } |
| 42 | 43 |
| 43 MockConnection::~MockConnection() { | 44 MockConnection::~MockConnection() { |
| 44 } | 45 } |
| 45 | 46 |
| 46 void MockConnection::AdvanceTime(QuicTime::Delta delta) { | 47 void MockConnection::AdvanceTime(QuicTime::Delta delta) { |
| 47 CHECK(has_mock_helper_) << "Cannot advance time unless a MockClock is being" | 48 CHECK(has_mock_helper_) << "Cannot advance time unless a MockClock is being" |
| 48 " used"; | 49 " used"; |
| 49 static_cast<MockHelper*>(helper())->AdvanceTime(delta); | 50 static_cast<MockHelper*>(helper())->AdvanceTime(delta); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 71 crypto_stream_ = stream; | 72 crypto_stream_ = stream; |
| 72 } | 73 } |
| 73 | 74 |
| 74 QuicCryptoStream* TestSession::GetCryptoStream() { | 75 QuicCryptoStream* TestSession::GetCryptoStream() { |
| 75 return crypto_stream_; | 76 return crypto_stream_; |
| 76 } | 77 } |
| 77 | 78 |
| 78 } // namespace test | 79 } // namespace test |
| 79 } // namespace tools | 80 } // namespace tools |
| 80 } // namespace net | 81 } // namespace net |
| OLD | NEW |