| 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/test_tools/quic_test_utils.h" | 5 #include "net/quic/test_tools/quic_test_utils.h" |
| 6 | 6 |
| 7 #include "base/sha1.h" | 7 #include "base/sha1.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "net/quic/crypto/crypto_framer.h" | 10 #include "net/quic/crypto/crypto_framer.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 namespace test { | 30 namespace test { |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // No-op alarm implementation used by MockHelper. | 33 // No-op alarm implementation used by MockHelper. |
| 34 class TestAlarm : public QuicAlarm { | 34 class TestAlarm : public QuicAlarm { |
| 35 public: | 35 public: |
| 36 explicit TestAlarm(QuicAlarm::Delegate* delegate) | 36 explicit TestAlarm(QuicAlarm::Delegate* delegate) |
| 37 : QuicAlarm(delegate) { | 37 : QuicAlarm(delegate) { |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual void SetImpl() override {} | 40 void SetImpl() override {} |
| 41 virtual void CancelImpl() override {} | 41 void CancelImpl() override {} |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace | 44 } // namespace |
| 45 | 45 |
| 46 QuicAckFrame MakeAckFrame(QuicPacketSequenceNumber largest_observed) { | 46 QuicAckFrame MakeAckFrame(QuicPacketSequenceNumber largest_observed) { |
| 47 QuicAckFrame ack; | 47 QuicAckFrame ack; |
| 48 ack.largest_observed = largest_observed; | 48 ack.largest_observed = largest_observed; |
| 49 ack.entropy_hash = 0; | 49 ack.entropy_hash = 0; |
| 50 return ack; | 50 return ack; |
| 51 } | 51 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 void MockHelper::AdvanceTime(QuicTime::Delta delta) { | 220 void MockHelper::AdvanceTime(QuicTime::Delta delta) { |
| 221 clock_.AdvanceTime(delta); | 221 clock_.AdvanceTime(delta); |
| 222 } | 222 } |
| 223 | 223 |
| 224 namespace { | 224 namespace { |
| 225 class NiceMockPacketWriterFactory | 225 class NiceMockPacketWriterFactory |
| 226 : public QuicConnection::PacketWriterFactory { | 226 : public QuicConnection::PacketWriterFactory { |
| 227 public: | 227 public: |
| 228 NiceMockPacketWriterFactory() {} | 228 NiceMockPacketWriterFactory() {} |
| 229 virtual ~NiceMockPacketWriterFactory() {} | 229 ~NiceMockPacketWriterFactory() override {} |
| 230 | 230 |
| 231 virtual QuicPacketWriter* Create( | 231 QuicPacketWriter* Create(QuicConnection* /*connection*/) const override { |
| 232 QuicConnection* /*connection*/) const override { | |
| 233 return new testing::NiceMock<MockPacketWriter>(); | 232 return new testing::NiceMock<MockPacketWriter>(); |
| 234 } | 233 } |
| 235 | 234 |
| 236 private: | 235 private: |
| 237 DISALLOW_COPY_AND_ASSIGN(NiceMockPacketWriterFactory); | 236 DISALLOW_COPY_AND_ASSIGN(NiceMockPacketWriterFactory); |
| 238 }; | 237 }; |
| 239 } // namespace | 238 } // namespace |
| 240 | 239 |
| 241 MockConnection::MockConnection(bool is_server) | 240 MockConnection::MockConnection(bool is_server) |
| 242 : QuicConnection(kTestConnectionId, | 241 : QuicConnection(kTestConnectionId, |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 // called. | 667 // called. |
| 669 factory_->current_writer_ = this; | 668 factory_->current_writer_ = this; |
| 670 return QuicPerConnectionPacketWriter::WritePacket(buffer, | 669 return QuicPerConnectionPacketWriter::WritePacket(buffer, |
| 671 buf_len, | 670 buf_len, |
| 672 self_address, | 671 self_address, |
| 673 peer_address); | 672 peer_address); |
| 674 } | 673 } |
| 675 | 674 |
| 676 } // namespace test | 675 } // namespace test |
| 677 } // namespace net | 676 } // namespace net |
| OLD | NEW |