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

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

Issue 1431693002: Change QuicAckFrame's revived_packets to be a single QuicPacketNumber. QUIC now ignores all but the… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106724344
Patch Set: Created 5 years, 1 month 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_framer.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_framer.h" 5 #include "net/quic/quic_framer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 2179
2180 EXPECT_EQ(QUIC_NO_ERROR, framer_.error()); 2180 EXPECT_EQ(QUIC_NO_ERROR, framer_.error());
2181 ASSERT_TRUE(visitor_.header_.get()); 2181 ASSERT_TRUE(visitor_.header_.get());
2182 EXPECT_TRUE(CheckDecryption(encrypted, !kIncludeVersion)); 2182 EXPECT_TRUE(CheckDecryption(encrypted, !kIncludeVersion));
2183 2183
2184 EXPECT_EQ(0u, visitor_.stream_frames_.size()); 2184 EXPECT_EQ(0u, visitor_.stream_frames_.size());
2185 ASSERT_EQ(1u, visitor_.ack_frames_.size()); 2185 ASSERT_EQ(1u, visitor_.ack_frames_.size());
2186 QuicAckFrame* frame = visitor_.ack_frames_[0]; 2186 QuicAckFrame* frame = visitor_.ack_frames_[0];
2187 EXPECT_EQ(0xBA, frame->entropy_hash); 2187 EXPECT_EQ(0xBA, frame->entropy_hash);
2188 EXPECT_EQ(UINT64_C(0x0123456789ABF), frame->largest_observed); 2188 EXPECT_EQ(UINT64_C(0x0123456789ABF), frame->largest_observed);
2189 EXPECT_EQ(0u, frame->revived_packets.size()); 2189 EXPECT_EQ(0u, frame->latest_revived_packet);
2190 ASSERT_EQ(500u, frame->missing_packets.NumPacketsSlow()); 2190 ASSERT_EQ(500u, frame->missing_packets.NumPacketsSlow());
2191 EXPECT_EQ(UINT64_C(0x0123456789ABE) - 499, frame->missing_packets.Min()); 2191 EXPECT_EQ(UINT64_C(0x0123456789ABE) - 499, frame->missing_packets.Min());
2192 EXPECT_EQ(UINT64_C(0x0123456789ABE), frame->missing_packets.Max()); 2192 EXPECT_EQ(UINT64_C(0x0123456789ABE), frame->missing_packets.Max());
2193 2193
2194 // Verify that the packet re-serializes identically. 2194 // Verify that the packet re-serializes identically.
2195 QuicFrames frames; 2195 QuicFrames frames;
2196 frames.push_back(QuicFrame(frame)); 2196 frames.push_back(QuicFrame(frame));
2197 scoped_ptr<QuicPacket> data(BuildDataPacket(*visitor_.header_, frames)); 2197 scoped_ptr<QuicPacket> data(BuildDataPacket(*visitor_.header_, frames));
2198 ASSERT_TRUE(data != nullptr); 2198 ASSERT_TRUE(data != nullptr);
2199 2199
(...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after
4401 EXPECT_CALL(visitor, OnStreamFrame(_)).Times(0); 4401 EXPECT_CALL(visitor, OnStreamFrame(_)).Times(0);
4402 EXPECT_CALL(visitor, OnAckFrame(_)).Times(0); 4402 EXPECT_CALL(visitor, OnAckFrame(_)).Times(0);
4403 EXPECT_CALL(visitor, OnPacketComplete()).Times(0); 4403 EXPECT_CALL(visitor, OnPacketComplete()).Times(0);
4404 4404
4405 EXPECT_FALSE(framer_.ProcessPacket(*packet)); 4405 EXPECT_FALSE(framer_.ProcessPacket(*packet));
4406 EXPECT_EQ(QUIC_INVALID_PACKET_HEADER, framer_.error()); 4406 EXPECT_EQ(QUIC_INVALID_PACKET_HEADER, framer_.error());
4407 } 4407 }
4408 4408
4409 } // namespace test 4409 } // namespace test
4410 } // namespace net 4410 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_framer.cc ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698