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 virtual void SetImpl() override {} |
41 virtual void CancelImpl() OVERRIDE {} | 41 virtual 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 virtual ~NiceMockPacketWriterFactory() {} |
230 | 230 |
231 virtual QuicPacketWriter* Create( | 231 virtual QuicPacketWriter* Create( |
232 QuicConnection* /*connection*/) const OVERRIDE { | 232 QuicConnection* /*connection*/) const override { |
233 return new testing::NiceMock<MockPacketWriter>(); | 233 return new testing::NiceMock<MockPacketWriter>(); |
234 } | 234 } |
235 | 235 |
236 private: | 236 private: |
237 DISALLOW_COPY_AND_ASSIGN(NiceMockPacketWriterFactory); | 237 DISALLOW_COPY_AND_ASSIGN(NiceMockPacketWriterFactory); |
238 }; | 238 }; |
239 } // namespace | 239 } // namespace |
240 | 240 |
241 MockConnection::MockConnection(bool is_server) | 241 MockConnection::MockConnection(bool is_server) |
242 : QuicConnection(kTestConnectionId, | 242 : QuicConnection(kTestConnectionId, |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 // called. | 669 // called. |
670 factory_->current_writer_ = this; | 670 factory_->current_writer_ = this; |
671 return QuicPerConnectionPacketWriter::WritePacket(buffer, | 671 return QuicPerConnectionPacketWriter::WritePacket(buffer, |
672 buf_len, | 672 buf_len, |
673 self_address, | 673 self_address, |
674 peer_address); | 674 peer_address); |
675 } | 675 } |
676 | 676 |
677 } // namespace test | 677 } // namespace test |
678 } // namespace net | 678 } // namespace net |
OLD | NEW |