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

Unified Diff: net/quic/quic_framer_test.cc

Issue 905033002: Fix compile errors introduced when editing QuicFramerTest during the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Move_is_fec_packet_85181879
Patch Set: Created 5 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer_test.cc
diff --git a/net/quic/quic_framer_test.cc b/net/quic/quic_framer_test.cc
index a85ec0a688c6ff8553378919b1bc7f0a62913101..28d96aded724c47d455f1c5b76ff7437c89cbd7f 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -176,7 +176,6 @@ class TestQuicVisitor : public ::net::QuicFramerVisitorInterface {
STLDeleteElements(&stop_waiting_frames_);
STLDeleteElements(&ping_frames_);
STLDeleteElements(&fec_data_);
- STLDeleteElements(&stream_data_);
}
void OnError(QuicFramer* f) override {
@@ -224,14 +223,7 @@ class TestQuicVisitor : public ::net::QuicFramerVisitorInterface {
bool OnStreamFrame(const QuicStreamFrame& frame) override {
++frame_count_;
- // Save a copy of the data so it is valid after the packet is processed.
- stream_data_.push_back(frame.GetDataAsString());
- QuicStreamFrame stream_frame(frame);
- // Make sure that the stream frame points to this data.
- stream_frame.data.Clear();
- stream_frame.data.Append(const_cast<char*>(stream_data_.back()->data()),
- stream_data_.back()->size());
- stream_frames_.push_back(stream_frame);
+ stream_frames_.push_back(new QuicStreamFrame(frame));
return true;
}
@@ -304,7 +296,7 @@ class TestQuicVisitor : public ::net::QuicFramerVisitorInterface {
scoped_ptr<QuicPacketPublicHeader> public_header_;
scoped_ptr<QuicPublicResetPacket> public_reset_packet_;
scoped_ptr<QuicVersionNegotiationPacket> version_negotiation_packet_;
- vector<QuicStreamFrame> stream_frames_;
+ vector<QuicStreamFrame*> stream_frames_;
vector<QuicAckFrame*> ack_frames_;
vector<QuicStopWaitingFrame*> stop_waiting_frames_;
vector<QuicPingFrame*> ping_frames_;
@@ -315,7 +307,6 @@ class TestQuicVisitor : public ::net::QuicFramerVisitorInterface {
QuicGoAwayFrame goaway_frame_;
QuicWindowUpdateFrame window_update_frame_;
QuicBlockedFrame blocked_frame_;
- vector<string*> stream_data_;
};
class QuicFramerTest : public ::testing::TestWithParam<QuicVersion> {
@@ -415,8 +406,8 @@ class QuicFramerTest : public ::testing::TestWithParam<QuicVersion> {
}
// Checks if the supplied string matches data in the supplied StreamFrame.
- void CheckStreamFrameData(string str, const QuicStreamFrame& frame) {
- scoped_ptr<string> frame_data(frame.GetDataAsString());
+ void CheckStreamFrameData(string str, QuicStreamFrame* frame) {
+ scoped_ptr<string> frame_data(frame->GetDataAsString());
EXPECT_EQ(str, *frame_data);
}
@@ -1274,9 +1265,10 @@ TEST_P(QuicFramerTest, StreamFrame) {
ASSERT_EQ(1u, visitor_.stream_frames_.size());
EXPECT_EQ(0u, visitor_.ack_frames_.size());
EXPECT_EQ(static_cast<uint64>(0x01020304),
- visitor_.stream_frames_[0].stream_id);
- EXPECT_TRUE(visitor_.stream_frames_[0].fin);
- EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654), visitor_.stream_frames_[0].offset);
+ visitor_.stream_frames_[0]->stream_id);
+ EXPECT_TRUE(visitor_.stream_frames_[0]->fin);
+ EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654),
+ visitor_.stream_frames_[0]->offset);
CheckStreamFrameData("hello world!", visitor_.stream_frames_[0]);
// Now test framing boundaries.
@@ -1320,9 +1312,10 @@ TEST_P(QuicFramerTest, StreamFrame3ByteStreamId) {
ASSERT_EQ(1u, visitor_.stream_frames_.size());
EXPECT_EQ(0u, visitor_.ack_frames_.size());
- EXPECT_EQ(GG_UINT64_C(0x00020304), visitor_.stream_frames_[0].stream_id);
- EXPECT_TRUE(visitor_.stream_frames_[0].fin);
- EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654), visitor_.stream_frames_[0].offset);
+ EXPECT_EQ(GG_UINT64_C(0x00020304), visitor_.stream_frames_[0]->stream_id);
+ EXPECT_TRUE(visitor_.stream_frames_[0]->fin);
+ EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654),
+ visitor_.stream_frames_[0]->offset);
CheckStreamFrameData("hello world!", visitor_.stream_frames_[0]);
// Now test framing boundaries.
@@ -1368,9 +1361,10 @@ TEST_P(QuicFramerTest, StreamFrame2ByteStreamId) {
ASSERT_EQ(1u, visitor_.stream_frames_.size());
EXPECT_EQ(0u, visitor_.ack_frames_.size());
EXPECT_EQ(static_cast<uint64>(0x00000304),
- visitor_.stream_frames_[0].stream_id);
- EXPECT_TRUE(visitor_.stream_frames_[0].fin);
- EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654), visitor_.stream_frames_[0].offset);
+ visitor_.stream_frames_[0]->stream_id);
+ EXPECT_TRUE(visitor_.stream_frames_[0]->fin);
+ EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654),
+ visitor_.stream_frames_[0]->offset);
CheckStreamFrameData("hello world!", visitor_.stream_frames_[0]);
// Now test framing boundaries.
@@ -1416,9 +1410,10 @@ TEST_P(QuicFramerTest, StreamFrame1ByteStreamId) {
ASSERT_EQ(1u, visitor_.stream_frames_.size());
EXPECT_EQ(0u, visitor_.ack_frames_.size());
EXPECT_EQ(static_cast<uint64>(0x00000004),
- visitor_.stream_frames_[0].stream_id);
- EXPECT_TRUE(visitor_.stream_frames_[0].fin);
- EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654), visitor_.stream_frames_[0].offset);
+ visitor_.stream_frames_[0]->stream_id);
+ EXPECT_TRUE(visitor_.stream_frames_[0]->fin);
+ EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654),
+ visitor_.stream_frames_[0]->offset);
CheckStreamFrameData("hello world!", visitor_.stream_frames_[0]);
// Now test framing boundaries.
@@ -1468,9 +1463,10 @@ TEST_P(QuicFramerTest, StreamFrameWithVersion) {
ASSERT_EQ(1u, visitor_.stream_frames_.size());
EXPECT_EQ(0u, visitor_.ack_frames_.size());
EXPECT_EQ(static_cast<uint64>(0x01020304),
- visitor_.stream_frames_[0].stream_id);
- EXPECT_TRUE(visitor_.stream_frames_[0].fin);
- EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654), visitor_.stream_frames_[0].offset);
+ visitor_.stream_frames_[0]->stream_id);
+ EXPECT_TRUE(visitor_.stream_frames_[0]->fin);
+ EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654),
+ visitor_.stream_frames_[0]->offset);
CheckStreamFrameData("hello world!", visitor_.stream_frames_[0]);
// Now test framing boundaries.
@@ -1586,9 +1582,10 @@ TEST_P(QuicFramerTest, RevivedStreamFrame) {
ASSERT_EQ(1u, visitor_.stream_frames_.size());
EXPECT_EQ(0u, visitor_.ack_frames_.size());
- EXPECT_EQ(GG_UINT64_C(0x01020304), visitor_.stream_frames_[0].stream_id);
- EXPECT_TRUE(visitor_.stream_frames_[0].fin);
- EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654), visitor_.stream_frames_[0].offset);
+ EXPECT_EQ(GG_UINT64_C(0x01020304), visitor_.stream_frames_[0]->stream_id);
+ EXPECT_TRUE(visitor_.stream_frames_[0]->fin);
+ EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654),
+ visitor_.stream_frames_[0]->offset);
CheckStreamFrameData("hello world!", visitor_.stream_frames_[0]);
}
@@ -1641,9 +1638,10 @@ TEST_P(QuicFramerTest, StreamFrameInFecGroup) {
ASSERT_EQ(1u, visitor_.stream_frames_.size());
EXPECT_EQ(0u, visitor_.ack_frames_.size());
- EXPECT_EQ(GG_UINT64_C(0x01020304), visitor_.stream_frames_[0].stream_id);
- EXPECT_TRUE(visitor_.stream_frames_[0].fin);
- EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654), visitor_.stream_frames_[0].offset);
+ EXPECT_EQ(GG_UINT64_C(0x01020304), visitor_.stream_frames_[0]->stream_id);
+ EXPECT_TRUE(visitor_.stream_frames_[0]->fin);
+ EXPECT_EQ(GG_UINT64_C(0xBA98FEDC32107654),
+ visitor_.stream_frames_[0]->offset);
CheckStreamFrameData("hello world!", visitor_.stream_frames_[0]);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698