Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: net/quic/quic_packet_generator_test.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_packet_creator_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_packet_generator.h" 5 #include "net/quic/quic_packet_generator.h"
6 6
7 #include <string> 7 #include <string>
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 15 matching lines...) Expand all
26 using testing::StrictMock; 26 using testing::StrictMock;
27 using testing::_; 27 using testing::_;
28 28
29 namespace net { 29 namespace net {
30 namespace test { 30 namespace test {
31 namespace { 31 namespace {
32 32
33 class MockDelegate : public QuicPacketGenerator::DelegateInterface { 33 class MockDelegate : public QuicPacketGenerator::DelegateInterface {
34 public: 34 public:
35 MockDelegate() {} 35 MockDelegate() {}
36 virtual ~MockDelegate() override {} 36 ~MockDelegate() override {}
37 37
38 MOCK_METHOD3(ShouldGeneratePacket, 38 MOCK_METHOD3(ShouldGeneratePacket,
39 bool(TransmissionType transmission_type, 39 bool(TransmissionType transmission_type,
40 HasRetransmittableData retransmittable, 40 HasRetransmittableData retransmittable,
41 IsHandshake handshake)); 41 IsHandshake handshake));
42 MOCK_METHOD0(CreateAckFrame, QuicAckFrame*()); 42 MOCK_METHOD0(CreateAckFrame, QuicAckFrame*());
43 MOCK_METHOD0(CreateFeedbackFrame, QuicCongestionFeedbackFrame*()); 43 MOCK_METHOD0(CreateFeedbackFrame, QuicCongestionFeedbackFrame*());
44 MOCK_METHOD0(CreateStopWaitingFrame, QuicStopWaitingFrame*()); 44 MOCK_METHOD0(CreateStopWaitingFrame, QuicStopWaitingFrame*());
45 MOCK_METHOD1(OnSerializedPacket, void(const SerializedPacket& packet)); 45 MOCK_METHOD1(OnSerializedPacket, void(const SerializedPacket& packet));
46 MOCK_METHOD2(CloseConnection, void(QuicErrorCode, bool)); 46 MOCK_METHOD2(CloseConnection, void(QuicErrorCode, bool));
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 generator_(42, &framer_, &random_, &delegate_), 109 generator_(42, &framer_, &random_, &delegate_),
110 creator_(QuicPacketGeneratorPeer::GetPacketCreator(&generator_)), 110 creator_(QuicPacketGeneratorPeer::GetPacketCreator(&generator_)),
111 packet_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr), 111 packet_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr),
112 packet2_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr), 112 packet2_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr),
113 packet3_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr), 113 packet3_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr),
114 packet4_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr), 114 packet4_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr),
115 packet5_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr), 115 packet5_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr),
116 packet6_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr), 116 packet6_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr),
117 packet7_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr) {} 117 packet7_(0, PACKET_1BYTE_SEQUENCE_NUMBER, nullptr, 0, nullptr) {}
118 118
119 virtual ~QuicPacketGeneratorTest() override { 119 ~QuicPacketGeneratorTest() override {
120 delete packet_.packet; 120 delete packet_.packet;
121 delete packet_.retransmittable_frames; 121 delete packet_.retransmittable_frames;
122 delete packet2_.packet; 122 delete packet2_.packet;
123 delete packet2_.retransmittable_frames; 123 delete packet2_.retransmittable_frames;
124 delete packet3_.packet; 124 delete packet3_.packet;
125 delete packet3_.retransmittable_frames; 125 delete packet3_.retransmittable_frames;
126 delete packet4_.packet; 126 delete packet4_.packet;
127 delete packet4_.retransmittable_frames; 127 delete packet4_.retransmittable_frames;
128 delete packet5_.packet; 128 delete packet5_.packet;
129 delete packet5_.retransmittable_frames; 129 delete packet5_.retransmittable_frames;
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 generator_.SetConnectionIdLength(7); 971 generator_.SetConnectionIdLength(7);
972 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length()); 972 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
973 generator_.SetConnectionIdLength(8); 973 generator_.SetConnectionIdLength(8);
974 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length()); 974 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
975 generator_.SetConnectionIdLength(9); 975 generator_.SetConnectionIdLength(9);
976 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length()); 976 EXPECT_EQ(PACKET_8BYTE_CONNECTION_ID, creator_->connection_id_length());
977 } 977 }
978 978
979 } // namespace test 979 } // namespace test
980 } // namespace net 980 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_packet_creator_test.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698